On  1-Oct-2008, at 00:32 , Martin v. Löwis wrote:


How does windows (and Python on windows) handle NFC versus NFD issues?

That's left to the application.

Can I have two files called "ümlaut.txt", one in NFD and one NFC form?

Yes, you can. It sounds confusing, but only in a theoretical way. You
never have combining characters on Windows (at least, I don't). The
keyboard input defaults to NFC, and users normally don't type file
names, anyways, except when creating the files - later, they just use
the mouse to indicate what file they want to act on.

And are both of those representable on the Python side (i.e. can they
both be returned from listdir() and passed to open())?

Certainly!

CIf I compare
these two filenames, do they compare differently?

Certainly!

Actually, that all sounds pretty non-confusing to me:-)

So, normal users will always have the one form, and if by chance they get the other form they can still use the file. Also from Python, even when doing listdir() and then open(), everything will work just as expected. That there are two files that have a similar visual representation is not too bad, the same happens with ellipses versus dot-dot-dot and many other cases.

Which means the only problem area left is unix filesystems (whether on Linux or mounted remotely on MacOS or whatever), where filenames are really byte strings with only / and nul illegal.



--
Jack Jansen, <[EMAIL PROTECTED]>, http://www.cwi.nl/~jack
If I can't dance I don't want to be part of your revolution -- Emma Goldman


_______________________________________________
Python-3000 mailing list
Python-3000@python.org
http://mail.python.org/mailman/listinfo/python-3000
Unsubscribe: 
http://mail.python.org/mailman/options/python-3000/archive%40mail-archive.com

Reply via email to