[Python-Dev] Inconsistencies if locale and filesystem?encodings are different

Oleg Broytman phd at phd.pp.ru
Thu Oct 7 21:42:47 CEST 2010


On Thu, Oct 07, 2010 at 09:12:13PM +0200, Victor Stinner wrote:
> Le jeudi 07 octobre 2010 18:44:19, Oleg Broytman a ?crit :
> >    My filesystems are always koi8-r, but sometimes I work with programs in
> > utf-8 locale. Just an example...
> 
> Are programs able to display correctly non-ascii filenames if your locale 
> encoding is different than your filesystem encoding?

   Most of them don't because - you are right - most programs assume fs
encoding to be the same as stdio locale. But some programs are more clever;
for example, one can define G_FILENAME_ENCODING env var to guide GTK2/GLib
programs; it can be a fixed encoding or a special value "@locale". On the
other side there are programs that ignore locale completely and read/write
filenames using their own fixed encoding; for example, Transmission
bittorrent client read/write files in the encoding defined in the .torrent
metafile.

Oleg.
-- 
     Oleg Broytman            http://phd.pp.ru/            phd at phd.pp.ru
           Programmers don't die, they just GOSUB without RETURN.


More information about the Python-Dev mailing list