#878334 wrong charset conversion in xls2csv

Package:
catdoc
Source:
catdoc
Description:
text extractor for MS-Office files
Submitter:
Robert Zavalczki
Date:
2025-06-12 09:33:02 UTC
Severity:
normal
Tags:
#878334#5
Date:
2017-10-12 22:08:39 UTC
From:
To:
This issue happens when running 'xls2csv' on XLS files containing
international characters (mainly from the ISO-8859-1 or CP1252 sets) and
when the default source charset is not apropriate to convert the characters.

You can reproduce it with the attached XLS file by running the command:

xls2csv -s cp1251 hungarian.xls

Details: the attached patch seems to fix the issue.

#878334#10
Date:
2025-06-12 09:15:18 UTC
From:
To:
On Fri, 13 Oct 2017 01:08:39 +0300 Robert Zavalczki  <robert.zavalczki@gmail.com> wrote:
 > You can reproduce it with the attached XLS file by running the command:
 >
 > xls2csv -s cp1251 hungarian.xls
 >
 > Details: the attached patch seems to fix the issue.

FYI I incorporated your test file and patch in my fork
https://github.com/skierpage/catdoc.
With the patch, `xls2csv hungarian.xls` generates the same characters
that I see opening the file in LibreOffice, e.g. "Munkáltató".
Your sample command line `xls2csv -s cp1251 hungarian.xls` still
generates the wrong characters, e.g. "Munkбltatу", maybe you meant to
write `-s cp1252` (which works)?