You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This can be fixed by just not doing the decode/encode, but processing the information as (undecoded) byte strings.
On UNIX-like systems filenames are just bytestrings, maybe we should treat ACLs in the same way.
As we do not know the encoding, there is no other way anyway. Even if we could find out one "correct" encoding, then especially on Samba shares, encoding could be mixed up. Sometimes one even sees total crap there, like double-encoded stuff.
Trying to guess the encoding does not work reliably for many cases.
Trying to decode and react to UnicodeDecodeErrors by decoding differently also only works for utf-8 (and ascii, which is a subset of utf-8), but does not for all single-byte encodings (because for them, usually all 256 possible values are mapped to characters).
Thus: just work with bytestrings, do not try to decode.
Note: this is platform-specific code, so this has to be checked and tested for all supported platforms.
See there: jborg/attic#351
This can be fixed by just not doing the decode/encode, but processing the information as (undecoded) byte strings.
On UNIX-like systems filenames are just bytestrings, maybe we should treat ACLs in the same way.
As we do not know the encoding, there is no other way anyway. Even if we could find out one "correct" encoding, then especially on Samba shares, encoding could be mixed up. Sometimes one even sees total crap there, like double-encoded stuff.
Trying to guess the encoding does not work reliably for many cases.
Trying to decode and react to UnicodeDecodeErrors by decoding differently also only works for utf-8 (and ascii, which is a subset of utf-8), but does not for all single-byte encodings (because for them, usually all 256 possible values are mapped to characters).
Thus: just work with bytestrings, do not try to decode.
Note: this is platform-specific code, so this has to be checked and tested for all supported platforms.
💰 there is a bounty for this
The text was updated successfully, but these errors were encountered: