How do i specify an input character coding for a convert-to command line usage?

How do I specify an input encoding for a file I want to convert in a headless mode:

libreoffice --headless --convert-to csv test.xls

This command messes up the non-ascii characters of the windows-1250 character set. Google-ing around, I found a hint that LibreOffice tries to import iso-8859-1 character coding by default and thus messes up the caracters.

The GUI operation of opening an xls file and saving as a .csv does translate the non-ascii characters corectly.

Please help.

Hi @stutek,

I’m not aware of a way to specify a particular character encoding when importing/converting files on the command line, but it does sound like a useful feature.

Unoconv might give you the flexibility that you desire, however you will have to install a separate program. Here are some quick notes from Unoconv regarding specifying the encoding for filters:

The default import filter for many imports…accepts
as the only argument the input encoding-type, so if you require utf-8 (76)
you can do:

-i FilterOptions=76

If the Unoconv option doesn’t work for you, please file an enhancement bug and provide as much information about this new feature as possible. Don’t forget to mark your bug as an ‘enhancement’. The QA team will be happy to help you triage your feature request in the bugtracker.

Please post a link to any bugs you file in a comment below using the format “fdo#123456”.

Thanks!

@qubit1 I opened a bug report.
Can’t comment on your post since i do not have enough karma, so the link is here:

https://bugs.freedesktop.org/show_bug.cgi?id=61960

@stutek, Thanks for the report! You now should have enough karma to be able to comment on Answers :slight_smile:

fdo#61960 has been marked as a duplicate of

Bug 36313 - CLI: Encoding issue when Converting documents: esp. UTF-8 in headless mode

Status: NEW.