> Is it possible a conversion from bytes (ANSI) to unicode fails on > windows?
It should fail sometimes, right? Not for windows-1252, but certainly for shift-jis (you know better than me). It seems that whether MultiByteToWideChar will fail depends on whether MB_ERR_INVALID_CHARS is given or not. I don't know what it will do if this flag is not given - my guess it fills in REPLACEMENT CHARACTER. > If not, is it allowed to convert to unicode with > PyUnicode_FSDecoder if function doesn't return str? For example, > os.stat() takes str as arguments but doesn't return str. This I don't understand. os.stat doesn't return text at all - so what do you want to convert? > # I noticed win_readlink() in Modules/posixmodule.c already unicode > # only. Maybe not so much problem? ;-) Well, readlink is new on Windows, and symlinks are not widespread. So there is no backwards compatibility concern here. Regards, Martin _______________________________________________ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com