Bug 106033 - LC_MESSAGE changes keyboard coding
Summary: LC_MESSAGE changes keyboard coding
Status: RESOLVED NOTOURBUG
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
5.3.0.3 release
Hardware: All All
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-02-15 20:39 UTC by Yan
Modified: 2017-03-06 05:30 UTC (History)
3 users (show)

See Also:
Crash report or crash signature:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Yan 2017-02-15 20:39:29 UTC
When LC_MESSAGE is set to e.g. POSIX (for general shell script function), LibreOffice takes the keyboard codes wrong if non-ASCII on an UTF-8 system. This behaviour is new with version 5.3 and is wrong in my understanding. In that case, LC_CTYPE should rather be used.
Comment 1 Yan 2017-02-17 18:28:37 UTC
I guess I need to make my report a little bit more clear.

If you have LC_MESSAGE on your system set to something like "POSIX", which is a legal value and automatically implicates ASCII coding, maybe because you are a programmer and want POSIX feedback of Unix tools under all circumstances, or you have compatibility problems if set differently, THEN

it is impossible to enter anything in your local tongue with your keyboard, let's say German when using LibreOffice, because the UTF-8 symbols are taken as, yes as what? Probably some extended ASCII.
Comment 2 Jean-Baptiste Faure 2017-02-18 22:09:07 UTC Comment hidden (obsolete)
Comment 3 Yan 2017-02-18 22:42:54 UTC
1. Step. Set your environment. It's important that LC_ALL is unset because it overrides all others.

export LC_ALL=
export LC_CTYPE=en_US.UTF-8
export LC_NUMERIC=en_US.UTF-8
export LC_TIME=de_DE.UTF-8
export LC_COLLATE=en_US.UTF-8
export LC_MONETARY=de_DE.UTF-8
export LC_MESSAGES=POSIX
export LC_PAPER=de_DE.UTF-8
export LC_NAME=de_DE.UTF-8
export LC_ADDRESS=de_DE.UTF-8
export LC_TELEPHONE=de_DE.UTF-8
export LC_MEASUREMENT=de_DE.UTF-8
export LC_IDENTIFICATION=de_DE.UTF-8

(This is bash code, /bin/sh would expect these lines splitted.)

2. If you do this in a script, then end it with calling a shell or libreoffice directly:

exec libreoffice

3. Call the script or call libreoffice in this environment if you typed in the lines directly.

4. Make a new Writer document (I guess any other will do, too, but I haven't tested).

5. Enter some characters with a localized UTF-8 keyboard, e.g. a German keyboard. Insert/Special Character won't do. Type an Ä Ö Ü or whatever you like, it just shouldn't be pure ASCII.

RESULT:
You will see two characters per keypress, both are the parts of the UTF-8 encoded character.

WHAT YOU SHOULD SEE INSTEAD:
You should see the character represented by the key you pressed.
Comment 4 Buovjaga 2017-03-04 17:15:25 UTC
No problem here (ö, ä with Finnish/Swedish keyboard layout)

Ubuntu 16.10
Version: 5.4.0.0.alpha0+
Build ID: 6cb9e6dad798ec59f055aebe84a9c4a21e4be40d
CPU threads: 4; OS: Linux 4.8; UI render: default; VCL: gtk2; 
TinderBox: Linux-rpm_deb-x86_64@70-TDF, Branch:master, Time: 2017-03-03_22:20:50
Locale: en-US (en_US.UTF-8); Calc: group
Comment 5 Yan 2017-03-05 00:00:33 UTC
My original distribution is Archlinux, I tried there with the packaged LibreOffice as well as the stock binaries, both same result.

Now I re-tested with Debian Stretch, and I can't reproduce indeed. Probably a downstream (Archlinux) problem. Since it is easy to fix, I close this issue completely without further investigation.
Comment 6 Buovjaga 2017-03-05 08:29:48 UTC
I tried with Arch Linux now, but could not reproduce.

Arch Linux 64-bit, KDE Plasma 5
Version: 5.3.0.3
Build ID: 5.3.0-2
CPU Threads: 8; OS Version: Linux 4.9; UI Render: default; VCL: kde4; Layout Engine: new; 
Locale: fi-FI (fi_FI.UTF-8); Calc: group
Comment 7 Yan 2017-03-06 05:30:20 UTC
Debian libreoffice resets the environment by starting it via script:

LO_SAVE_LC_ALL="$LC_ALL"
LC_ALL=C
export LC_ALL

What exactly happens on your machine depends on the scripts called implicitly.