Skip to content

Commit

Permalink
SP-1260 Fix UTF-16 Filename Encoding (#46)
Browse files Browse the repository at this point in the history
* changed line 310 to return a utf-8 compatible version of the filename
  • Loading branch information
ortizjeronimo authored Aug 10, 2024
1 parent 77515e1 commit 8c0bbf6
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 8 deletions.
6 changes: 4 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Added
- Upcoming changes...

## [1.13.1] - PLACEHOLDER
## [1.14.0] - 2024-08-09
### Added
- Added support for Python3.12
- Module `pkg_resources` has been replaced with `importlib_resources`
- Module `pkg_resources` has been replaced with `importlib_resources`
- Added support for UTF-16 filenames

## [1.13.0] - 2024-06-05
### Added
Expand Down Expand Up @@ -336,3 +337,4 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
[1.12.2]: https://github.com/scanoss/scanoss.py/compare/v1.12.1...v1.12.2
[1.12.3]: https://github.com/scanoss/scanoss.py/compare/v1.12.2...v1.12.3
[1.13.0]: https://github.com/scanoss/scanoss.py/compare/v1.12.3...v1.13.0
[1.14.0]: https://github.com/scanoss/scanoss.py/compare/v1.13.0...v1.14.0
2 changes: 1 addition & 1 deletion src/scanoss/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,4 @@
THE SOFTWARE.
"""

__version__ = '1.13.0'
__version__ = '1.14.0'
6 changes: 1 addition & 5 deletions src/scanoss/winnowing.py
Original file line number Diff line number Diff line change
Expand Up @@ -307,11 +307,7 @@ def wfp_for_contents(self, file: str, bin_file: bool, contents: bytes) -> str:
return ''
# Print file line
content_length = len(contents)
# Use repr() to get an unambiguous string representation
file = repr(file)
# Remove the surrounding quotes that repr() adds
file = file[1:-1]
wfp_filename = file
wfp_filename = repr(file).strip("'") # return a utf-8 compatible version of the filename
if self.obfuscate: # hide the real size of the file and its name, but keep the suffix
wfp_filename = f'{self.ob_count}{pathlib.Path(file).suffix}'
self.ob_count = self.ob_count + 1
Expand Down

0 comments on commit 8c0bbf6

Please sign in to comment.