zipfile with umlaut in filename
Patrick Useldinger
uselpa at myrealbox.com
Tue Apr 29 15:03:41 EDT 2003
Martin v. Löwis wrote:
> And why would you think that \x94 is "o-umlaut"?
I don't, WinZip does ;-)
And being compatible to WinZip doesn't seem so bad to me.
> It appears that Python puts the non-ASCII characters into the zipfile
> as the system reports them (i.e. in the ANSI code page on your
> system); winzip apparently converts them to some other encoding first,
> probably code page 437 or code page 850.
>
> To get the effect of Winzip in Python, when adding a file with name N,
> do
> zfile.write(N, unicode(N, "cp1252").encode("cp437"))
> and then try to open the zipfile with Winzip.
You are right, this works (both code pages, actually). I must definitely
revise the encoding and codepage stuff... but you've saved me from
writing a decompression program myself.
Thank you.
More information about the Python-list
mailing list