➜

This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

作者 Laurent.Mazuel
收信人 Laurent.Mazuel, r.david.murray, serhiy.storchaka, vstinner
日期 2014-01-22.07:39:32
SpamBayes Score -1.0
Marked as misclassified 是
Message-id <1390376373.04.0.990904120739.issue20329@psf.upfronthosting.co.za>
In-reply-to
内容
Thanks for your answer.

I think you can't transcode internal zip filenames to FS encoding. Actually, in Unix the FS only stores bytes for filename, there is no "FS encoding". Then, if you change your locale, the filename printed will change too in your console. If you transcode filename using the current locale, unzipping twice the same file with two different locales will lead to two different files, which is not (I think) you are intending for.
The problem will not arise in Windows (NTFS is UTF-16) nor MAC OSX (UTF-8)

Moreover, a simple "unzip" works like a charm. It doesn't care about encoding or current locale and extract the file using the initial bytes in the zip. Unzipping twice with the two different locales creates only one file.

An interesting link (even if it is not an official reference):
http://unix.stackexchange.com/questions/2089/what-charset-encoding-is-used-for-filenames-and-paths-on-linux
历史
日期 用户 动作 参数
2014-01-22 07:39:33Laurent.Mazuel修改recipients: + Laurent.Mazuel, vstinner, r.david.murray, serhiy.storchaka
2014-01-22 07:39:33Laurent.Mazuel修改messageid: <1390376373.04.0.990904120739.issue20329@psf.upfronthosting.co.za>
2014-01-22 07:39:33Laurent.Mazuel链接issue20329 messages
2014-01-22 07:39:32Laurent.Mazuel创建