Bazaar-NG traffic #2
John A Meinel
john at arbash-meinel.com
Tue Oct 11 14:55:44 BST 2005
Magnus Therning wrote:
> On Tue, Oct 11, 2005 at 08:33:17AM -0500, John A Meinel wrote:
>
>>David Allouche wrote:
...
>>Do you have any of these directories/files available? I would be
>>curious what this returns:
>>
>>python -c "import os; print os.listdir(u'.')"
>>versus
>>python -c "import os; print os.listdir('.')"
>>
>>The first should try and interpret the names and return unicode, the
>>second should just do ascii names (possibly just byte-stream names).
>
>
> Both return a list containing all the files in the current dir on my
> Linux machine. The first one is a list of unicode strings ([u'str1',
> u'str2']). The second is a list of regular strings (['str1', 'str2']).
> I.e. exactly what you predicted.
Naturally, I would expect that. :) What I wanted to know was what
happens when you have non-ascii characters in that directory?
On my Linux and Mac machines (with en_US.UTF-8 encoding) it decodes the
filenames as utf-8, which is perfectly correct.
On my Windows machine, (I assume) it uses the Unicode api, to get the
Windows' unicode name (which is also correct).
My question is what happens with these files that David is concerned
about. Will they be decoded correctly? Or will we just get a bogus value?
John
=:->
>
> /M
>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 253 bytes
Desc: OpenPGP digital signature
Url : https://lists.ubuntu.com/archives/bazaar/attachments/20051011/a2816684/attachment.pgp
More information about the bazaar
mailing list