Function FcConfigEnsure globally sets the locale by doing:
setlocale (LC_ALL, "");
This countermands any locale settings in the calling program. For example, GNU Emacs sets LC_NUMERIC to "C" which is undone by the fontconfig library. In turn, this breaks Emacs' lisp reader.
Gentoo bug: https://bugs.gentoo.org/650332
GNU Emacs bug: https://debbugs.gnu.org/30788
fixed in git 923b5be. thanks.
(In reply to Akira TAGOH from comment #1)
> fixed in git 923b5be. thanks.
Unfortunately, this doesn't fix it. The following will still break Emacs (e.g. latest released version 25.3):
$ unset LANG LC_ALL
$ LC_NUMERIC=de_DE.UTF-8 emacs -Q
Hm, okay. I should leave the locale setting to applications then even though one might misses features if they don't do the right thing there. removed the locale related code in git.
Reopening per comment 3.
Ah, silly me: fixed by
Author: Akira TAGOH <email@example.com>
Date: Thu Mar 15 12:17:52 2018 +0900
Leave the locale setting to applications
Although this thread indicates that the problem has been resolved, this does not seem to be the case in the current git source. The changes introduced by 98eaef69 are still present. I.e. in multiple places the code calls setlocale(LC_all,""). This clobbers the current locale settings established by the callling program.
I got here by debugging a problem reported against current gnuplot that so far as I can tell is directly caused by this change to libfontconfig. The program sets and relies on LC_NUMERIC == "C", but after calling into libfontconfig this may have been changed to something else. In particular if the default locale from the environment uses comma as a decimal point, bad things happen.
I suggest that 98eaef69 be reverted. A library call should not change the caller's locale.
I don't see what exactly issues you are facing. there are no code such as calling setlocale in the latest library anymore but keeps it in standalone tools. that shouldn't affects other programs.
plus, 98eaef69 is to revert changes like 923b5be6 and 9a0fcb94, and it is same what you were complaining. you seem getting confused. anyway, please mention what version of fontconfig you were trying and check if it is the latest or not. if you are using fontconfig from the package of any distro, please ask for maintainer to fix this. this has been fixed in 2.13.1 anyway.