You are not logged in.

#1 2023-09-01 07:10:22

heddxh
Member
Registered: 2023-01-21
Posts: 16

Chinese characters appear garbled a gtk4 program but normal in flatpak

The program is Newsflash.

I've raised the issues upstream, but found that flatpak package is normal.

Image link:  https://gitlab.com/news-flash/news_flas … 145948.png

Last edited by heddxh (2023-09-01 07:46:19)

Offline

#2 2023-09-01 07:24:52

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 76,103

Re: Chinese characters appear garbled a gtk4 program but normal in flatpak

Please replace the oversized image w/ a link and be a bit more elaborate on the situation.
The errors on the left column look like a locale issue, so post the output of

localectl
locale -a
locale

Offline

#3 2023-09-01 07:45:35

heddxh
Member
Registered: 2023-01-21
Posts: 16

Re: Chinese characters appear garbled a gtk4 program but normal in flatpak

Chinese characters in Left article view -> summary area is broken.

heddxh@myArchLinux ~> localectl
System Locale: LANG=en_US.UTF-8
    VC Keymap: (unset)         
   X11 Layout: (unset)         
heddxh@myArchLinux ~> locale -a
C
C.UTF-8
en_US.utf8
POSIX
zh_CN.utf8
heddxh@myArchLinux ~> locale 
LANG=zh_CN.UTF-8
LC_CTYPE="zh_CN.UTF-8"
LC_NUMERIC="zh_CN.UTF-8"
LC_TIME="zh_CN.UTF-8"
LC_COLLATE="zh_CN.UTF-8"
LC_MONETARY="zh_CN.UTF-8"
LC_MESSAGES="zh_CN.UTF-8"
LC_PAPER="zh_CN.UTF-8"
LC_NAME="zh_CN.UTF-8"
LC_ADDRESS="zh_CN.UTF-8"
LC_TELEPHONE="zh_CN.UTF-8"
LC_MEASUREMENT="zh_CN.UTF-8"
LC_IDENTIFICATION="zh_CN.UTF-8"
LC_ALL=

And sorry for the big image. I will use link instead.

Offline

#4 2023-09-01 11:10:37

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 76,103

Re: Chinese characters appear garbled a gtk4 program but normal in flatpak

While the system differs from the shell locale, this looks ok.
Plasma sometimes screws the locales up: https://wiki.archlinux.org/title/KDE#Pl … e_settings

Is the problem limited to (that particular element of) newsflash?

Offline

#5 2023-09-01 12:18:43

heddxh
Member
Registered: 2023-01-21
Posts: 16

Re: Chinese characters appear garbled a gtk4 program but normal in flatpak

> cat ~/.config/plasma-localerc

[Formats]
LANG=zh_CN. UTF-8

[Translations]
LANGUAGE=zh_CN:en_US

Is the problem limited to (that particular element of) newsflash?

Yes.  At least there is no problem with the apps I have installed .

Offline

#6 2023-09-01 12:21:19

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 76,103

Re: Chinese characters appear garbled a gtk4 program but normal in flatpak

If that's the *literal* content of the file, it's obviously garbage (see the stray blank)
Log out and remove it or at least fix the "LANG=zh_CN. UTF-8" to "LANG=zh_CN.UTF-8" (from a console login, do NOT log into anything plasma to do this)

Check the file contents after a re-login and then the impact on newsflash.

Offline

#7 2023-09-01 12:22:14

heddxh
Member
Registered: 2023-01-21
Posts: 16

Re: Chinese characters appear garbled a gtk4 program but normal in flatpak

Just found that if I use the local service (crawl locally), the Chinese characters of the article details is also garbled. When I grab the full text, the article details show up correctly.
I am using the cloud service miniflux in the picture on the first post, and the Chinese characters in the article details is correctly。

Offline

#8 2023-09-01 13:30:57

heddxh
Member
Registered: 2023-01-21
Posts: 16

Re: Chinese characters appear garbled a gtk4 program but normal in flatpak

If that's the *literal* content of the file, it's obviously garbage (see the stray blank)

Sorry, that is my mistake. The file is:

[Formats]
LANG=zh_CN.UTF-8

[Translations]
LANGUAGE=zh_CN:en_US

Offline

#9 2023-09-01 14:01:22

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 76,103

Re: Chinese characters appear garbled a gtk4 program but normal in flatpak

So not KDE's fault.

When I grab the full text, the article details show up correctly.

Can you elaborate on that? You mean when you copy-and-paste the text into some editor?

Did you use the flatpak w/ the exact same configuration for the data source (since apparently that's very relevant)
Is there a way to see the raw, unformated text that newsflash then renders (like ctrl+u in a browser)?

Edit: https://gitlab.com/news-flash/news_flas … _382031200

Last edited by seth (2023-09-01 14:15:50)

Offline

#10 2023-09-01 14:40:09

heddxh
Member
Registered: 2023-01-21
Posts: 16

Re: Chinese characters appear garbled a gtk4 program but normal in flatpak

Sorry for the misunderstanding. Crawling full articles means: https://gitlab.com/news-flash/news_flas … l-articles

Based on the mentioned issue, I looked at both program versions of the database. The flatpak version is correct, while the data in official package is garbled.
(Specifically, there is only a problem with the summary column of the article table)

Offline

#11 2023-09-01 14:43:22

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 76,103

Re: Chinese characters appear garbled a gtk4 program but normal in flatpak

Can you post both files (good and bad) to eg. http://0x0.st ?

Offline

#12 2023-09-01 14:54:30

heddxh
Member
Registered: 2023-01-21
Posts: 16

Re: Chinese characters appear garbled a gtk4 program but normal in flatpak

This is the bad database: http://0x0.st/Hp_A.sqlite
And this the good one(in flatpak): http://0x0.st/Hp_a.sqlite

Offline

#13 2023-09-01 20:58:18

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 76,103

Re: Chinese characters appear garbled a gtk4 program but normal in flatpak

The junk there is what you get when you interpret the actual UTF-8 (from the "good" database) as ISO-8859-1/LATIN1, but I've no idea how this happened since the feed in https://onojyun.com/feed/ is clearly UTF-8 encoded (and marked as such) and your system doesn't have such locale nor indication of such locale, so this would have been done on "assumption".

You could try to wipe the cache and see whether the issue remains and then ask upstream whether this has been an issue in the (recent) past and what actually generates that data (eg. a 3rd party process?)

Offline

#14 2023-09-02 07:38:17

heddxh
Member
Registered: 2023-01-21
Posts: 16

Re: Chinese characters appear garbled a gtk4 program but normal in flatpak

I completely uninstall the package and deleted the associated configuration and cache from the package in home directory and installed it again, and the problem persists. I'll describe this in detail to upstream and keep it updated.

Thank you very much for your patience and professionalism!

Offline

Board footer

Powered by FluxBB