[Python-Dev] Python-3.0, unicode, and os.environ
Guido van Rossum
guido at python.org
Sat Dec 6 20:13:38 CET 2008
On Sat, Dec 6, 2008 at 10:53 AM, <glyph at divmod.com> wrote:
> On 02:34 pm, phd at phd.pp.ru wrote:
>> I agree 100%. Russian Unix users use at least 5 different encodings
>> (koi8-r, cp1251 and utf-8 are the most frequent in use, cp866 and
>> iso-8859-5 are less frequent). I have an FTP server with some filenames in
>> koi8 encoding - these filenames are for unix clients, - and some filenames
>> in cp1251 for w32 clients. Sometimes I run utf-8 xterm (I am
>> a commandline/console unixhead) for my needs (read email, write files in
>> utf-8 with characters beyond koi8-r, which is my primary encoding) - and
>> I still can work with filenames in koi8/cp1251 encodings. My filemanager
>> (Midnight Commander, for the matter) shows these files and directories as
>> "?????.???", but I can chdir to such directories, and I can open such
>> files. It would be a big bad blow for me if filemanagers (or other
>> programs) start to filter these filenames.
> I find it interesting to note that the only users in this discussion who
> actually have these problems in real life all have this attitude. It is
> expected that in an imperfect world we will have imperfect encodings, but it
> is super important that software which can open files can deal with not
> understanding the character translation of the filename.
For file managers and similar tools I am absolutely 100% in agreement
-- that's why the binary APIs are there.
Most apps aren't file managers or ftp clients though. The sky is not falling.
--Guido van Rossum (home page: http://www.python.org/~guido/)
More information about the Python-Dev