[BUG] Unicode string must be always used with encodings

Alexander Belchenko bialix at ukr.net
Tue Sep 27 06:37:30 BST 2005


Robey Pointer пишет:
> 
> The trick is to use a unicode string for os.listdir:
> 
>  >>> os.listdir('/Users/robey/crap')
> ['rand\xc3\xb8m stuff']
>  >>> os.listdir(u'/Users/robey/crap')
> [u'rand\xf8m stuff']

Hey, it's worked! This trick will really help:

 >>> import os
 >>> os.listdir(u'.')
[u'\u043f\u0440\u0438\u0432\u0435\u0442.txt', u'1.txt', u'fte.dsk']

Thank you.

Alexander





More information about the bazaar mailing list