[Python-3000] [Python-Dev] Filename as byte string in python 2.6 or 3.0?

Adam Olsen rhamph at gmail.com
Tue Sep 30 01:34:43 CEST 2008


On Mon, Sep 29, 2008 at 5:31 PM, "Martin v. Löwis" <martin at v.loewis.de> wrote:
>>> ISTM that 8859-1 is all about decoding, so I don't understand why
>>> you say it is a way not to decode.
>>
>> 8859-1 has no invalid bytes and is a 1-to-1 mapping.  If you have an
>> API that always returns unicode but accepts an encoding you can use
>> it, then reencode using 8859-1 to get back the original bytes.
>
> I still don't understand. 8859-1 is an encoding, not a datatype.
> So how do you propose file names to be represented? "In 8859-1"
> is not a valid answer, because you cannot derive an implementation
> from that answer (atleast, I cannot). Please explain.

Decoding UTF-8 using 8859-1 gives you garbage, but it's lossless and
reversible, and that's all a backup program would need.


-- 
Adam Olsen, aka Rhamphoryncus


More information about the Python-3000 mailing list