[issue13643] 'ascii' is a bad filesystem default encoding

STINNER Victor report at bugs.python.org
Thu Dec 22 02:32:52 CET 2011


STINNER Victor <victor.stinner at haypocalc.com> added the comment:

On 22/12/2011 02:16, Martin Pool wrote:
> The proposal is that in some cases where Python currently assumes
> filenames are ascii on Linux, it ought to instead assume they are
> utf-8.

Oh, I expected a use case describing the problem, not the proposed 
solution :-)

>> You want to use UTF-8 instead of ASCII, so what? What do you
>> want to do with your nicely well decoded filenames? You cannot print it
>> to your terminal nor pass it to a subprocess, because your terminal uses
>> ASCII, as subprocess. I don't see how it would help you.
>
> When the application has a unicode string,

Where does this string come from? (It is an important question).

If your locale encoding is ASCII, you cannot write such non-ASCII 
filenames using the keyboard for example.

 > with working around this when the filenames really are
 > valid in what should be the user's locale,

On your computer, UTF-8 is maybe a good candidate for "what should be 
the user's locale", but you cannot generalize for all computers.

I also wanted to force UTF-8 everywhere, but you cannot do that or your 
program will just not work in some configurations.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue13643>
_______________________________________


More information about the Python-bugs-list mailing list