zipfile with umlaut in filename

Patrick Useldinger uselpa at myrealbox.com
Sat Apr 26 11:40:12 CEST 2003


Martin v. Löwis wrote:
>> Hello everybody,
>> I have a problem when creating an archive using zipfile. If the name 
>> of the file to be added contains a special character like an umlaut, 
>> this character gets replaced by another character.
>> What can I do against this?
> 
> I'm not sure you can do anything. Zipfiles only support ASCII file 
> names, to my knowledge.

Well, doing the same thing with WinZip works ok and keeps the name as it 
should.
Also, reading *that* archive back in Python yields, as a result of 
namelist():
['Der h\x94fische Charakter der Liebe.doc']
for a file called
'Der höfische Character der Liebe'.

-PU





More information about the Python-list mailing list