pombreda / libarchive

Automatically exported from code.google.com/p/libarchive
Other
0 stars 0 forks source link

Cannot identify (and extract) Big5 filename #376

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. call archive_entry_pathname_w with a zip file which contains big5 filename
2.
3.

What is the expected output? What do you see instead?
expected: could identify and extract big5 filename correctly
actual result: mbtowc would return fail and EILSEQ when meeting some big5 
characters

archive_wstring_append_from_mbs: 
p=***�ꤤ���D��/SteadyHand/Thumbs.db***
archive_wstring_append_from_mbs: mbs=�(0xffffffb0)
archive_wstring_append_from_mbs: mbtowc failed
archive_wstring_append_from_mbs: is invalid char
archive_wstring_append_from_mbs: mbs=�(0xffffffea)
archive_wstring_append_from_mbs: mbs=�(0xffffffb2)
archive_wstring_append_from_mbs: mbtowc failed
archive_wstring_append_from_mbs: is invalid char
archive_wstring_append_from_mbs: mbs=�(0xffffffd5)
archive_wstring_append_from_mbs: mbtowc failed
archive_wstring_append_from_mbs: is invalid char

In the above example, b0ea (國 in big5) b2d5 (組 in big5), 0xb0, 0xb2, 0xd5 
was considered invalid while 0xea considered valid.

What version are you using?
3.1.2

On what operating system?
Linux

How did you build?  (cmake, configure, or pre-packaged binary)
configure

What compiler or development environment (please include version)?
gcc-4.8.2

Please provide any additional information below.

Original issue reported on code.google.com by frank...@goodhorse.idv.tw on 12 Sep 2014 at 8:51

GoogleCodeExporter commented 9 years ago
Could you provide us a (small) example archive that demonstrates this problem?

What are your locale settings?

Is this a custom program?  If so, are you calling setlocale()?  With what 
arguments?

Original comment by kientzle@gmail.com on 13 Sep 2014 at 4:49