Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 229567 - KDE using x11-libs/qt-3.3.8b displays CJK incorrectly under the locale of en_US.utf8.
Summary: KDE using x11-libs/qt-3.3.8b displays CJK incorrectly under the locale of en_...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Unspecified (show other bugs)
Hardware: x86 Linux
: High normal
Assignee: Gentoo KDE team
URL: https://bugs.launchpad.net/debian/+so...
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-06-26 13:14 UTC by Hongjiu Zhang
Modified: 2008-10-28 23:55 UTC (History)
1 user (show)

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


Attachments
Patch to solve. (asian-language.patch,1.16 KB, patch)
2008-07-23 06:47 UTC, Hongjiu Zhang
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Hongjiu Zhang 2008-06-26 13:14:16 UTC
It is about x11-libs/qt-3.3.8. I try to find all the issues about it and got no. If this is duplicate to others, I am very sorry about it.

KDE 3.5.9 using QT 3.3.8 displays CJK words incorrectly if user uses POSIX or Latin locale as their locale. A black dot will display instead of the correct CJK words. It means that searching Japanese website using google in English will got a lot of unreadable dot.

Thank you very much for all your help.

Reproducible: Always

Steps to Reproduce:
emerge kdebase-meta
Actual Results:  
Some of the CJK words became black dots, some are in foreign language fonts(like Chinese in Japanese fonts).

Expected Results:  
Words are displayed well.

It seems that Ubuntu and Debian has solved such a bug by using a patch.

61_eastern_asian_languagues.diff:
--- qt-x11-free-3.3.8b/src/kernel/qfontdatabase.cpp	2008-01-15 21:09:13.000000000 +0200
+++ qt-x11-free-3.3.8b/src/kernel/qfontdatabase.cpp	2008-03-10 11:34:22.000000000 +0200
@@ -966,20 +966,22 @@
 
 #ifdef Q_WS_X11
     if (script == QFont::Han) {
-	// modify script according to locale
-	static QFont::Script defaultHan = QFont::UnknownScript;
-	if (defaultHan == QFont::UnknownScript) {
-	    QCString locale = setlocale(LC_ALL, NULL);
-	    if (locale.contains("ko"))
-		defaultHan = QFont::Han_Korean;
-	    else if (locale.contains("zh_TW") || locale.contains("zh_HK"))
-		defaultHan = QFont::Han_TraditionalChinese;
-	    else if (locale.contains("zh"))
-		defaultHan = QFont::Han_SimplifiedChinese;
-	    else
-		defaultHan = QFont::Han_Japanese;
-	}
-	script = defaultHan;
+        // modify script according to locale
+        static QFont::Script defaultHan;
+        QCString locale = setlocale(LC_ALL, NULL);
+
+        if (locale.contains("ko"))
+            defaultHan = QFont::Han_Korean;
+        else if (locale.contains("zh_TW") || locale.contains("zh_HK"))
+            defaultHan = QFont::Han_TraditionalChinese;
+        else if (locale.contains("zh"))
+            defaultHan = QFont::Han_SimplifiedChinese;
+        else if (locale.contains("ja"))
+            defaultHan = QFont::Han_Japanese;
+        else
+            defaultHan = QFont::Han; // don't change
+
+        script = defaultHan;
     }
 #endif
 
It could be found on the page: http://patches.ubuntu.com/by-release/atomic/debian/q/qt-x11-free/qt-x11-free_3:3.3.8b-5.patch
Comment 1 Hongjiu Zhang 2008-07-22 01:43:58 UTC
I am sorry to report this bug to the wrong team.
Comment 2 Hongjiu Zhang 2008-07-23 06:47:19 UTC
Created attachment 161169 [details, diff]
Patch to solve.

Or a shorter one.
Comment 3 Hongjiu Zhang 2008-08-08 16:28:57 UTC
x11-libs/qt-3.3.8b dumped without this problem solved.
Comment 4 Ben de Groot (RETIRED) gentoo-dev 2008-10-28 23:55:07 UTC
Patch applied