Bug 460704 - Unicode is not working in sample address display
Summary: Unicode is not working in sample address display
Status: RESOLVED FIXED
Alias: None
Product: systemsettings
Classification: Applications
Component: kcm_regionandlang (show other bugs)
Version: 5.26.0
Platform: Neon Linux
: NOR minor
Target Milestone: ---
Assignee: Plasma Bugs List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2022-10-19 11:15 UTC by Sadi
Modified: 2022-11-03 03:08 UTC (History)
3 users (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments
Screenshot of Unicode issue in sample addresses (16.89 KB, image/jpeg)
2022-10-20 10:21 UTC, Sadi
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Sadi 2022-10-19 11:15:45 UTC
SUMMARY
***
The sample address shown in "Region & Language - System Settings" displays country name as "T<U00FC>rkiye"
***

EXPECTED RESULT
The country name should be displayed "Türkiye"; it seems there's a problem with Unicode characters there. 

SOFTWARE/OS VERSIONS
Operating System: KDE neon 5.26
KDE Plasma Version: 5.26.0
KDE Frameworks Version: 5.98.0
Qt Version: 5.15.6
Comment 1 Nate Graham 2022-10-19 17:59:30 UTC
What font are you using?
Comment 2 Sadi 2022-10-20 10:20:45 UTC
(In reply to Nate Graham from comment #1)
> What font are you using?

I'm using Roboto but I don't think it's related with the font I choose because (a) I can see the character "umlaut u" (and other similar ones) in the heading, and (b) this didn't change when I applied others fonts like  Noto Sans or Inter.
Comment 3 Sadi 2022-10-20 10:21:59 UTC
Created attachment 153055 [details]
Screenshot of Unicode issue in sample addresses
Comment 4 Nate Graham 2022-10-20 16:30:09 UTC
Thanks.
Comment 5 Akseli Lahtinen 2022-10-20 17:56:30 UTC
Could you give me the output of "localectl list-locales >> locales.txt" ? 

I wonder if this is happening because of lack of UTF-8 locales, or something else entirely.
Comment 6 Akseli Lahtinen 2022-10-20 17:59:11 UTC
Also if you could, can you also share the current locale settings you have with just typing "locale" in console?
Comment 7 Sadi 2022-10-21 12:40:52 UTC
localectl list-locales:

C.UTF-8
en_AG.UTF-8
en_AU.UTF-8
en_BW.UTF-8
en_CA.UTF-8
en_DK.UTF-8
en_GB.UTF-8
en_HK.UTF-8
en_IE.UTF-8
en_IL.UTF-8
en_IN.UTF-8
en_NG.UTF-8
en_NZ.UTF-8
en_PH.UTF-8
en_SG.UTF-8
en_US.UTF-8
en_ZA.UTF-8
en_ZM.UTF-8
en_ZW.UTF-8
tr_CY.UTF-8
tr_TR.UTF-8

locale:

LANG=en_US.UTF-8
LANGUAGE=en_US
LC_CTYPE=en_US.UTF-8
LC_NUMERIC=en_US.UTF-8
LC_TIME=C
LC_COLLATE=tr_TR.UTF-8
LC_MONETARY=C
LC_MESSAGES=en_US.UTF-8
LC_PAPER=C
LC_NAME=C
LC_ADDRESS=C
LC_TELEPHONE=en_US.UTF-8
LC_MEASUREMENT=C
LC_IDENTIFICATION=en_US.UTF-8
LC_ALL=
Comment 8 Nate Graham 2022-10-21 13:13:16 UTC
Looks like we're not specifying the unicode variant of the locales for some of the settings.
Comment 9 Bug Janitor Service 2022-10-22 13:42:36 UTC
A possibly relevant merge request was started @ https://invent.kde.org/plasma/plasma-workspace/-/merge_requests/2249
Comment 10 hanyoung 2022-11-03 03:05:22 UTC
Git commit b4d7c2675604cf3e10f29dcf9fc1e95cebfc0d7b by Han Young.
Committed on 03/11/2022 at 03:05.
Pushed by hanyoung into branch 'master'.

kcms/regionandlanguage: convert ASCII unicode symbol to QChar

The locale files in `/usr/share/i18n/locales` contain ASCII Unicode symbol, we need to replace it with real Unicode rune. 

**country_name "T\<U00FC>rkiye"** to **country_name "Türkiye"**

When we are at it, also add caching to `parseLocaleFile`, otherwise we parse multiple locale format files every time we want address, phone number examples.

And add an autotest for all of this.

M  +15   -1    kcms/region_language/CMakeLists.txt
A  +10   -0    kcms/region_language/autotests/CMakeLists.txt
A  +57   -0    kcms/region_language/autotests/regionandlangexampletest.cpp     [License: GPL(v2.0+)]
M  +55   -2    kcms/region_language/exampleutility.cpp
M  +2    -0    kcms/region_language/exampleutility.h

https://invent.kde.org/plasma/plasma-workspace/commit/b4d7c2675604cf3e10f29dcf9fc1e95cebfc0d7b
Comment 11 hanyoung 2022-11-03 03:08:09 UTC
Git commit 6271a78f8c2414a5912180192e26476fb52ea313 by Han Young.
Committed on 03/11/2022 at 03:08.
Pushed by hanyoung into branch 'Plasma/5.26'.

kcms/regionandlanguage: convert ASCII unicode symbol to QChar

The locale files in `/usr/share/i18n/locales` contain ASCII Unicode symbol, we need to replace it with real Unicode rune. 

**country_name "T\<U00FC>rkiye"** to **country_name "Türkiye"**

When we are at it, also add caching to `parseLocaleFile`, otherwise we parse multiple locale format files every time we want address, phone number examples.

And add an autotest for all of this.


(cherry picked from commit b4d7c2675604cf3e10f29dcf9fc1e95cebfc0d7b)

M  +15   -1    kcms/region_language/CMakeLists.txt
A  +10   -0    kcms/region_language/autotests/CMakeLists.txt
A  +57   -0    kcms/region_language/autotests/regionandlangexampletest.cpp     [License: GPL(v2.0+)]
M  +55   -2    kcms/region_language/exampleutility.cpp
M  +2    -0    kcms/region_language/exampleutility.h

https://invent.kde.org/plasma/plasma-workspace/commit/6271a78f8c2414a5912180192e26476fb52ea313