Bug 1383967 - I18N: [fix available] XSupportsLocale returns false for cs_CZ.UTF-8
Summary: I18N: [fix available] XSupportsLocale returns false for cs_CZ.UTF-8
Keywords:
Status: CLOSED DUPLICATE of bug 1383646
Alias: None
Product: Fedora
Classification: Fedora
Component: libX11
Version: 25
Hardware: x86_64
OS: Linux
unspecified
unspecified
Target Milestone: ---
Assignee: Adam Jackson
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2016-10-12 09:24 UTC by Dandim
Modified: 2017-04-25 05:29 UTC (History)
10 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2017-04-25 05:29:01 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)
Printscreen of bug (18.59 KB, image/png)
2016-10-12 09:24 UTC, Dandim
no flags Details
gdb_output (52.38 KB, text/plain)
2016-10-12 19:31 UTC, Dandim
no flags Details
gdb2 output (84.56 KB, text/plain)
2016-10-13 15:19 UTC, Dandim
no flags Details
simple X11 standalone program (207 bytes, text/x-csrc)
2017-03-06 20:58 UTC, Caolan McNamara
no flags Details


Links
System ID Private Priority Status Summary Last Updated
FreeDesktop.org 98219 0 None None None 2017-03-06 21:06:56 UTC

Description Dandim 2016-10-12 09:24:39 UTC
Created attachment 1209519 [details]
Printscreen of bug

Description of problem:


Version-Release number of selected component (if applicable):


How reproducible:


Steps to Reproduce:
1. open any document by Libreoffice via GUI
2. or start Libreoffice by cli: libreoffice test.odt
3.

Actual results:
I18N: X Window System doesn't support locale "cs_CZ.UTF-8"

Expected results:
Start Libreoffice

Additional info:
I can open document by command: LANG=en_US.UTF-8 libreoffice test.odt

Comment 1 Stephan Bergmann 2016-10-12 09:33:52 UTC
The problem apparently is that LO's idea of character encoding used in the pathname /home/daridim/Stažené/test.odt doesn't match the OS's idea.

What's the output of "locale; pwd" command on the command line, while in that /home/daridim/Stažené/ directory?

Comment 2 Dandim 2016-10-12 10:56:57 UTC
[12:56:18][dandim][~/Stažené]:locale; pwd
LANG=cs_CZ.UTF-8
LC_CTYPE="cs_CZ.UTF-8"
LC_NUMERIC="cs_CZ.UTF-8"
LC_TIME="cs_CZ.UTF-8"
LC_COLLATE="cs_CZ.UTF-8"
LC_MONETARY="cs_CZ.UTF-8"
LC_MESSAGES="cs_CZ.UTF-8"
LC_PAPER="cs_CZ.UTF-8"
LC_NAME="cs_CZ.UTF-8"
LC_ADDRESS="cs_CZ.UTF-8"
LC_TELEPHONE="cs_CZ.UTF-8"
LC_MEASUREMENT="cs_CZ.UTF-8"
LC_IDENTIFICATION="cs_CZ.UTF-8"
LC_ALL=
/home/dandim/Stažené

Comment 3 Stephan Bergmann 2016-10-12 11:34:11 UTC
The symptoms smell like LO is doing a bad call to setlocale(2) in sal/osl/unx/nlsupport.cxx.  (One result would be that the call to XSupportsLocale(3) in vcl/unx/generic/app/i18n_im.cxx, leading to the quoted stderr output.  Another result would be that LO assumes pathnames in plain ASCII or ISO-8859-1 instead of UTF-8 notation, so wouldn't find files in paths containing non-ASCII characters, like /home/daridim/Stažené/test.odt, so would (silently) immediately terminate again when asked to open such a file.)

Comment 4 Dandim 2016-10-12 11:40:58 UTC
Hmm :-)
If i moved file test.odt to home directory (/home/dandim/) i can open it!
But if i moved back to /home/dandim/Stažené, i cannot open it again.
Stažené mean Downloads (in English) :-)
I looks like that LO has problem with characters in Czech "Stažené"...

Comment 5 Stephan Bergmann 2016-10-12 15:04:26 UTC
Dandim, if you feel reasonably at home with gdb, what you could do is produce a trace of LO's setlocale calls, maybe that would give a clue.  What you'd need to do is (ideally after installing the libreoffice debuginfo package):

Run 'gdb /lib64/libreoffice/program/soffice.bin', enter the commands 'break setlocale' (upon which you may need to confirm 'y'), then 'commands' (prompt changes to '>'), 'backtrace', 'continue', 'end' (prompt changes back), 'run', then capture the gdb output.

Comment 6 Dandim 2016-10-12 19:31:49 UTC
Created attachment 1209750 [details]
gdb_output

Comment 7 Stephan Bergmann 2016-10-13 07:47:00 UTC
Ah, that's without glibc-debuginfo, so it doesn't print the arguments to the setlocale calls (hadn't thought about mentioning this; if you have time, it would be really great if you could redo the experiment after installing glibc debuginfo).  But most of them should be of the "harmless" query-only kind with a null locale string argument (and when I checked myself under GNOME, the only call sequence that temporarily sets a new locale and then resets to the original one is the four calls from osl_getTextEncodingFromLocale right at the start).  However, this is apparently under KDE, and maybe also with a relevant difference in Input Method support compared to the scenario I tested; will investigate further.

Comment 8 Dandim 2016-10-13 14:54:35 UTC
Sorry, but package glibc-debuginfo doenst exist in Fedora 25 repository. :-)

Comment 9 Stephan Bergmann 2016-10-13 15:00:05 UTC
(In reply to Dandim from comment #8)
> Sorry, but package glibc-debuginfo doenst exist in Fedora 25 repository. :-)

'dnf install-debuginfo glibc' should do it

Comment 10 Dandim 2016-10-13 15:19:46 UTC
Created attachment 1210177 [details]
gdb2 output

Comment 11 Dandim 2016-10-21 11:25:11 UTC
Hi,
i upgraded Libreoffice package (via updates-testing repo) to version LibreOffice 5.2.3.1.
I have still problems with opening files.

Comment 12 Milos Jakubicek 2017-03-05 21:25:35 UTC
Hi Stephan,

any updates on this? I just hit this as well after upgrading from F24, and it is really annoying.

Comment 13 Milos Jakubicek 2017-03-06 17:24:25 UTC
It seems this has something to do with a new version of libX11, see:
https://bugs.archlinux.org/task/51442

Comment 14 Stephan Bergmann 2017-03-06 17:38:23 UTC
Sorry, I'm still clueless as to what exactly fails there.  (And I can't reproduce the issue.)  But now there's apparently two users for whom it fails.  What desktop system is each of you using, GNOME, KDE, ...?  And after upgrading from F24, still using X11 or Wayland?  And any changes in what exactly gets output to stderr and/or is displayed as a LibreOffice error box since attachment 1209519 [details]?

Comment 15 Caolan McNamara 2017-03-06 20:28:41 UTC
SAL_USE_VCLPLUGIN=gen soffice
reproduces this

Comment 16 Caolan McNamara 2017-03-06 20:58:18 UTC
Created attachment 1260563 [details]
simple X11 standalone program

gcc demox.c -lX11

Comment 17 Caolan McNamara 2017-03-06 21:04:50 UTC
LANG=en_IE.UTF-8 ./a.out
good
LANG=de_DE.UTF-8 ./a.out
good
LANG=fi_FI.UTF-8 ./a.out
good
LANG=am_ET.UTF-8 ./a.out
good
LANG=sr_CS.UTF-8 ./a.out
good
LANG=cs_CZ.UTF-8 ./a.out
bad

Comment 18 Milos Jakubicek 2017-03-19 09:36:39 UTC
I had a look at this yesterday again after I found out that only one of two identical workstations suffered from this issue. I turned out that the one affected had glibc-langpacks-all and glibc-langpack-cs installed, while the other one had none of these but it had an old locale archive (probably from pre-F24 times). On the affected machine I removed both glibc-langpacks-all and glibc-langpack-cs, after which:
- accented characters started working
- the startup error message changed to "Gtk-WARNING **: Locale not supported by C library. Using the fallback 'C' locale."
- it still was not possible to open files with non-ASCII characters anywhere in their path.

Then I did "dnf reinstall libreoffice*" and "dnf install glibc-langpacks-all glibc-langpack-cs", and now everything works like a charm again!

So - while the core issue is the libX11 bug, there is something weird going on in libreoffice as well.

Comment 19 Petr Pisar 2017-04-25 05:29:01 UTC

*** This bug has been marked as a duplicate of bug 1383646 ***


Note You need to log in before you can comment on or make changes to this bug.