Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion pyFileFixity/lib/_compat.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ def b(x):
import codecs
def b(x):
if isinstance(x, _str):
return codecs.latin_1_encode(x)[0]
return codecs.utf_8_encode(x)[0]
Copy link

Copilot AI Nov 13, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The encoding has been changed from latin-1 to utf-8 in the b() function, but the _bytes() function on line 66 still uses 'latin-1' encoding. For consistency and to properly support UTF-8 characters (like Cyrillic), this should also be updated to 'utf-8'.

Note that this change also requires updating corresponding decode('latin-1') calls elsewhere in the codebase (e.g., in header_ecc.py line 603 and structural_adaptive_ecc.py line 657) to use decode('utf-8') instead, to ensure proper round-trip encoding/decoding of file paths with non-ASCII characters.

Copilot uses AI. Check for mistakes.
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@copilot open a new pull request to apply changes based on this feedback

else:
return x

Expand Down
Loading