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

Victor Stinner victor.stinner at haypocalc.com
Thu Feb 9 22:47:16 CET 2012


> If this is needed, it should be spelled "os.getlocaleencoding()" (or
> "sys.getlocaleencoding()"?)

There is already a locale.getpreferredencoding(False) function which
give your the current locale encoding. The problem is that the current
locale encoding may change and so you have to get the new value each
time than you would like to encode or decode data.

Victor


More information about the Python-Dev mailing list