Help needed with filenames

"Martin v. Löwis" martin at v.loewis.de
Sun May 10 03:40:44 EDT 2009


> Can anyone tell me what I should be doing here?

The console uses the "OEM code page". The Windows conversion
routine from Unicode to the OEM code page provides the lossy
conversion that you observe in listing.

Unfortunately, the OEM code page conversion is not available
from Python. What you can do is to use

  u.encode(sys.stdout.encoding, "replace")

This will replace unprintable characters with question marks.

Regards,
Martin



More information about the Python-list mailing list