Message377932
ZipFile has problems with filename charset in .zip archives having filenames charset encoded in OEM code page.
ZipFile assumes that OEM code page always means "cp437". Actually many popular .zip packers (for example, Windows internal "zip folders" tool) use OEM code page corresponding to system locale to write file names in .zip files.
To read such files correctly we should detect correct OEM code page from system locale instead of sticking to cp437.
Here is locale-to-oem-code-page conversion table, generated from Wine source code:
https://github.com/unxed/oemcp/blob/master/oemcp.txt
Sample archive is attached. The file inside should be extracted as "Новый текстовый документ.txt" when ru_RU system locale is set. |
|
Date |
User |
Action |
Args |
2020-10-04 11:36:22 | ivan.sorokin.tech | set | recipients:
+ ivan.sorokin.tech |
2020-10-04 11:36:22 | ivan.sorokin.tech | set | messageid: <1601811382.76.0.398158982461.issue41929@roundup.psfhosted.org> |
2020-10-04 11:36:22 | ivan.sorokin.tech | link | issue41929 messages |
2020-10-04 11:36:22 | ivan.sorokin.tech | create | |
|