[Python-Dev] Python-3.0, unicode, and os.environ
Adam Olsen
rhamph at gmail.com
Thu Dec 11 19:04:20 CET 2008
On Thu, Dec 11, 2008 at 6:41 AM, Ulrich Eckhardt
<eckhardt at satorlaser.com> wrote:
> On Thursday 11 December 2008, Steve Holden wrote:
>> re-present it to the filesystem to manipulate the file. What are we
>> supposed to do with the "special type"?
>
> You receive from readdir() and pass it to stat(), simple as that. No
> conversions from the native representation needed. If you need a textual
> representation, then you have to convert it and you have to do so explicitly
> according to whatever logic your application requires.
The simplest solution there is to have windows bytes APIs that return
raw UTF-16 bytes (note that windows does NOT guaranteed to be valid
unicode, despite being much more likely than on linux). The only real
issue I see is that UTF-16 isn't an ASCII superset, so it won't print
nicely.
In other words, bytes can be your special type.
--
Adam Olsen, aka Rhamphoryncus
More information about the Python-Dev
mailing list