Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 679674 - dev-libs/icu-63.1-r1 doesn't respect user locale
Summary: dev-libs/icu-63.1-r1 doesn't respect user locale
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal
Assignee: Gentoo Office Team
URL:
Whiteboard:
Keywords: PATCH
Depends on:
Blocks:
 
Reported: 2019-03-07 11:32 UTC by Tiago Sousa
Modified: 2021-01-14 14:25 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
Patch to icu-63.1-r1.ebuild (icu-respect-user-locale.patch,780 bytes, patch)
2019-03-07 11:32 UTC, Tiago Sousa
Details | Diff
Disable UTF-8 hardcoding, which enables locale detection again (icu-disable-utf8.patch,337 bytes, patch)
2020-01-14 17:40 UTC, Tiago Sousa
Details | Diff
Disable UTF-8 hardcoding for 65.1 (icu-disable-utf8-65.patch,339 bytes, patch)
2020-03-09 16:01 UTC, Tiago Sousa
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Tiago Sousa 2019-03-07 11:32:19 UTC
Created attachment 568082 [details, diff]
Patch to icu-63.1-r1.ebuild

My system uses locale ISO-8859-15. I noticed that qmmp (the music player), with the "Simple User Interface" which is in QT, stopped showing certain directories with latin characters.

Digging around I found a similar complaint in SUSE which traced it down to a recent change in icu 61.1:

https://bugzilla.suse.com/show_bug.cgi?id=1095425

The problem is that icu started to assume that all linux distros should have "define U_CHARSET_IS_UTF8 1" by default, which ignores the user locale! It is claimed this is done for efficiency but, in Gentoo, we lose nothing if there's a compile-time choice.

So, attached is a trivial patch to the icu ebuild so that it recognizes the unicode use flag. If it is active, do nothing, since icu already makes sure UTF8 is forced by default. If it is disabled, then force U_CHARSET_IS_UTF8 to 0, and this way icu respects the user locale again.

After recompiling icu, and restarting qmmp, the problem was solved (no other recompilations needed). I believe nothing is lost with this method and "legacy" users are respected.

Thanks!
Comment 1 Jeroen Roovers (RETIRED) gentoo-dev 2019-03-07 11:39:17 UTC
Wouldn't you want to fix qmmp instead?
Comment 2 Tiago Sousa 2019-03-07 11:52:46 UTC
(In reply to Jeroen Roovers from comment #1)
> Wouldn't you want to fix qmmp instead?

I didn't consider that option because I figured this is something "sistemic" and there may be lots of other programs with this preconception. I don't use many QT apps so I have no idea how widespread it might be.

In my view, it was icu who changed the default, and in Gentoo it's trivial to make that default configurable. Seems the easiest way to me.

In SuSE they even reverted icu's assumption, as per their bug (notice it links to https://build.opensuse.org/request/show/613919 -- Add icu-susevers.diff and disable UTF-8 assumption).
Comment 3 Tiago Sousa 2020-01-14 17:40:49 UTC
Created attachment 603270 [details, diff]
Disable UTF-8 hardcoding, which enables locale detection again

It seems everyone uses UTF-8, as it remains UNCONFIRMED, yet the issue persists.

At this point, if anyone's affected by this, just copy icu-disable-utf8.patch to /etc/portage/patches/dev-libs/icu/ and be done with it. Patch ripped from SuSE which shipped patched packages last december, check out the previous link.
Comment 4 Tiago Sousa 2020-03-09 16:01:22 UTC
Created attachment 617620 [details, diff]
Disable UTF-8 hardcoding for 65.1

Quick update for icu-65.1-r1.
Comment 5 Larry the Git Cow gentoo-dev 2020-11-28 18:54:09 UTC
The bug has been referenced in the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=9442d61a4c4d8483f53868776586446aba7a7d78

commit 9442d61a4c4d8483f53868776586446aba7a7d78
Author:     Andreas K. Hüttel <dilfridge@gentoo.org>
AuthorDate: 2020-11-28 18:51:05 +0000
Commit:     Andreas K. Hüttel <dilfridge@gentoo.org>
CommitDate: 2020-11-28 18:53:56 +0000

    dev-libs/icu: Allow non-utf8 locales again
    
    Bug: https://bugs.gentoo.org/679674
    Package-Manager: Portage-3.0.9, Repoman-3.0.2
    Signed-off-by: Andreas K. Hüttel <dilfridge@gentoo.org>

 dev-libs/icu/files/icu-68.1-nonunicode.patch | 12 ++++++++++++
 dev-libs/icu/icu-68.1.ebuild                 |  1 +
 2 files changed, 13 insertions(+)
Comment 6 Tiago Sousa 2021-01-14 14:25:53 UTC
I just tested stock dev-libs/icu-68.2 and the ebuild correctly patches icu. More hardcoded than my proposal, but works for me. Thank you.