We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
There is an issue with filenames with accents across Mac/Win:
>>> str_win = 'Τρέχοντα υπόλοιπα προμηθευτών.xlsx' # Copied from Explorer >>> str_mac = 'Τρέχοντα υπόλοιπα προμηθευτών.xlsx' # Copied from Finder >>> str_win == str_mac False >>> str_win.encode('utf-8') b'\xce\xa4\xcf\x81\xce\xad\xcf\x87\xce\xbf\xce\xbd\xcf\x84\xce\xb1 \xcf\x85\xcf\x80\xcf\x8c\xce\xbb\xce\xbf\xce\xb9\xcf\x80\xce\xb1 \xcf\x80\xcf\x81\xce\xbf\xce\xbc\xce\xb7\xce\xb8\xce\xb5\xcf\x85\xcf\x84\xcf\x8e\xce\xbd.xlsx' >>> str_mac.encode('utf-8') b'\xce\xa4\xcf\x81\xce\xb5\xcc\x81\xcf\x87\xce\xbf\xce\xbd\xcf\x84\xce\xb1 \xcf\x85\xcf\x80\xce\xbf\xcc\x81\xce\xbb\xce\xbf\xce\xb9\xcf\x80\xce\xb1 \xcf\x80\xcf\x81\xce\xbf\xce\xbc\xce\xb7\xce\xb8\xce\xb5\xcf\x85\xcf\x84\xcf\x89\xcc\x81\xce\xbd.xlsx' >>> import unicodedata >>> unicodedata.normalize('NFD', str_win) == str_mac True >>> str_win == unicodedata.normalize('NFC', str_mac) True >>> from pathlib import Path >>> Path(str_win).is_file() # on Windows True >>> Path(str_win).is_file() # on Mac True >>> from pathlib import Path >>> Path(str_mac).is_file() # on Windows False >>> Path(str_mac).is_file() # on Mac True
Therefore, normalize with unicodedata.normalize('NFC', str_mac_or_win) to solve the issue.
unicodedata.normalize('NFC', str_mac_or_win)
https://nedbatchelder.com/blog/201106/filenames_with_accents.html
Remove the fuzzy matching of filenames previously attempted to solve the issue.
The text was updated successfully, but these errors were encountered:
bc09621
No branches or pull requests
There is an issue with filenames with accents across Mac/Win:
Therefore, normalize with
unicodedata.normalize('NFC', str_mac_or_win)
to solve the issue.https://nedbatchelder.com/blog/201106/filenames_with_accents.html
Remove the fuzzy matching of filenames previously attempted to solve the issue.
The text was updated successfully, but these errors were encountered: