Ask Your Question

command line conversion - encoding changes from UTF8 to 'Non-ISO extended-ASCII' [closed]

asked 2015-03-13 12:38:00 +0200

Alexis Huxley gravatar image

updated 2020-09-02 01:29:23 +0200

Alex Kemp gravatar image

I have some XLS files. I was using LO for editing them and Gnumeric's ssconvert tool for doing command line conversions of them into CSV (which I need for reasons outside the scope of this post).

For reasons of convenience/cleanliness, I would like to use LO for doing both. So now I'm trying to use this command to do the conversion:

libreoffice -env:UserInstallation=file:///home/$USER/.libreoffice-alt --headless --convert-to csv  <my-xls-file>

('-env:...' is to ensure this LO instance does something even though I already have LO GUI open.)

This command gives almost the same results as ssconvert, except that the encoding has changed; with ssconvert output looked like this:

...,"Stechlinseestraße 999",...

with libreoffice output looks like this:

...,"Stechlinseestra�e 999",...

According to the 'file' command the encoding has changed from:

UTF-8 Unicode text

to one of:

ISO-8859 text
Non-ISO extended-ASCII text

(The encoding of the ssconvert-converted files is always UTF-8, but the encoding of the libreoffice-converted files varies, presumably depending on the characters in the various input files, which include text written in German, Czech, Slovak, Danish, Hungarian.)

I did find some references to the output encoding being derived from the locale, but prefixing the conversion command with:


made no difference. Anybody any ideas how to enforce UTF-8 output encoding? Thanks!

For info, this is on an Ubuntu 14.04.2 system, LO is Build ID: 420m0(Build:2).

edit retag flag offensive reopen merge delete

Closed for the following reason question is not relevant or outdated by Alex Kemp
close date 2020-08-17 15:48:59.734982

1 Answer

Sort by » oldest newest most voted

answered 2015-03-13 14:42:42 +0200

LogicDaemon gravatar image

updated 2015-03-13 14:43:50 +0200

Here's what I found:

libreoffice -env:UserInstallation=file:///home/$USER/.libreoffice-alt --headless --convert-to "csv:Text - txt - csv (StarCalc):44,34,76,1,1/1" <my-xls-file>

that's where:

  1. libreoffice --help
edit flag offensive delete link more


Also refer examples under v4.4 using the --infilter argument in bug fdo#36313 e.g., CSV:44,34,UTF8.

oweng gravatar imageoweng ( 2015-03-14 03:28:24 +0200 )edit

Thanks, but unfortunately, that seems not to work in the LO version I specified. Both sets of infilter arguments produce:

libreoffice -env:UserInstallation=file:///home/$USER/.libreoffice-alt --headless --convert-to "csv:Text - txt - csv (StarCalc):44,34,76,1,1/1"  <my-xls-file>
    convert <my-xls-file> -> <my-csv-file> using Text - txt - csv (StarCalc):44,34,76,1,1/1
Error: Please reverify input parameters...
Alexis Huxley gravatar imageAlexis Huxley ( 2015-03-16 08:13:12 +0200 )edit

Note that the --infilter options are for input files, not output.

erAck gravatar imageerAck ( 2017-07-19 11:29:31 +0200 )edit

Question Tools

1 follower


Asked: 2015-03-13 12:38:00 +0200

Seen: 5,737 times

Last updated: Mar 13 '15