I have two errors to report. Elixir forum can not handle the chars I’m trying to submit. Erlang :zip doesn’t appear to either. I’m having to redact the chars from my question/observation. I get an internal server error when I tried to save my question.
The sequence of chars from a hexdump are:
0000000 2d20 85e3 e38b 8b85 85e3 e38b 8b85 000a
The sequence from okteta:
20 2D E3 85 8B E3 85 8B E3 85 8B E3 85
I am trying read the contents of a zip file. The .zip file contains a file called “cloud/1533930101293-(omited chars).docx”
When I call zip_list_dir :zip.zip_list_dir(zip_handle)
I get a list of the files. However, the file with the “(omited chars)” gets printed as “cloud/1533930101293-ãããã.docx”
Here is some of the iex output of :zip.zip_list_dir:
{:zip_file, ‘cloud/1533930179386-test.docx’,
{:file_info, 6368, :regular, :read_write, {{2018, 8, 10}, {19, 50, 10}},
{{2018, 8, 10}, {19, 50, 10}}, {{2018, 8, 10}, {19, 50, 10}}, 54, 1, 0, 0,
0, 0, 0}, [], 2621, 5676},
{:zip_file,
[99, 108, 111, 117, 100, 47, 49, 53, 51, 51, 57, 51, 48, 49, 48, 49, 50, 57,
51, 45, 227, 133, 139, 227, 133, 139, 227, 133, 139, 227, 133, 139, 46,
100, 111, 99, 120],
{:file_info, 6470, :regular, :read_write, {{2018, 8, 10}, {19, 50, 10}},
{{2018, 8, 10}, {19, 50, 10}}, {{2018, 8, 10}, {19, 50, 10}}, 54, 1, 0, 0,
0, 0, 0}, [], 8356, 5779}
Note the first :zip_file “cloud/1533930179386-test.docx” displays nicely. However, the “crazy” file displays as a list. I haven’t been able to get the filename returned by :zip to display correctly
tmp = [99, 108, 111, 117, 100, 47, 49, 53, 51, 51, 57, 51, 48, 49, 48, 49, 50, 57,
51, 45, 227, 133, 139, 227, 133, 139, 227, 133, 139, 227, 133, 139, 46,
100, 111, 99, 120]
Before I go crazy with my hex editor, I’d like to know if I’m missing something silly. Or if :zip doesn’t support this type of encoding. Ubuntu & Arch Linux’s zip 3.0 application are able to unzip the file correctly. Chrome can copy and paste the chars into the text window. (I just get errors when I try to save it)