>>>>> Bob Ippolito <[EMAIL PROTECTED]> (BI) wrote:

>>>>> import sys
>>>>> sys.getfilesystemencoding()
>BI> 'utf-8'

It is UTF-8, but you must be careful: the filenames are in normalized (or
whatever they call it) UTF-8, meaning that accented letters are split up
into the letter followed by the accent. The filename API does accept the
composed accented letters, but normalizes them, and that is what the
listdir calls return.

>>> fn = u'\u00E1'
>>> f = open(fn,'w')
>>> f.close()

We now have a file with name 'รก'

>>> import os
>>> os.listdir (u'.')
[u'a\u0301']

The accent follows the 'a'.
-- 
Piet van Oostrum <[EMAIL PROTECTED]>
URL: http://www.cs.uu.nl/~piet [PGP 8DAE142BE17999C4]
Private email: [EMAIL PROTECTED]
_______________________________________________
Pythonmac-SIG maillist  -  Pythonmac-SIG@python.org
http://mail.python.org/mailman/listinfo/pythonmac-sig

Reply via email to