[Python-Dev] Add a new "locale" codec?

Victor Stinner victor.stinner at haypocalc.com
Wed Feb 8 10:12:40 CET 2012


2012年2月8日 Simon Cross <hodgestar+pythondev at gmail.com>:
> Is the idea to have:
>>  b"foo".decode("locale")
>> be roughly equivalent to
>>  encoding = locale.getpreferredencoding(False)
>  b"foo".decode(encoding)
>> ?

Yes. Whereas:
b"foo".decode(sys.getfilesystemencoding())
is equivalent to
encoding = locale.getpreferredencoding(True)
b"foo".decode(encoding)
Victor


More information about the Python-Dev mailing list

AltStyle によって変換されたページ (->オリジナル) /