Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 11 Mar 2002 23:06:20 +0900 (JST)
From:      SASAKI Katuhiro <sahiro@crest.ocn.ne.jp>
To:        FreeBSD-gnats-submit@freebsd.org
Subject:   ports/35779: bug: x11-toolkits/qt23 does not know zh_CN.EUC and zh_CN.eucCN
Message-ID:  <20020311140642.5126CBAE7@sahiro.merseine.nu>

next in thread | raw e-mail | index | archive | help

>Number:         35779
>Category:       ports
>Synopsis:       bug: x11-toolkits/qt23 does not know zh_CN.EUC and zh_CN.eucCN
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-ports
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Mon Mar 11 06:10:00 PST 2002
>Closed-Date:
>Last-Modified:
>Originator:     SASAKI Katuhiro
>Release:        FreeBSD 4.5-RELEASE-p2 i386
>Organization:
personal
>Environment:
>Description:
The QGbkCodec::heuristicNameMatch() method lacks support for "zh_CN.EUC" and 
"zh_CN.eucCN" locale.

>How-To-Repeat:
Compile code below with qt2 and run.

#include <cstdio>
#include <qtextcodec.h>
#include <qtextstream.h>

int main ()
{
	QTextStream* qout = new QTextStream(stdout, IO_WriteOnly);
	QTextCodec* codec = QTextCodec::codecForName("zh_CN.eucCN");

	if (codec) {
		*qout << codec->name() << endl;
	} else {
		*qout << "No match." << endl;
	}

	delete qout;

	return  0;
}

>Fix:
Apply a patch as below to x11-toolkits/qt23.

diff -urN /usr/ports/x11-toolkits/qt23/Makefile qt23/Makefile
--- /usr/ports/x11-toolkits/qt23/Makefile	Wed Feb 20 01:50:44 2002
+++ qt23/Makefile	Sun Mar  3 18:15:17 2002
@@ -7,7 +7,7 @@
 
 PORTNAME?=	qt
 PORTVERSION?=	2.3.1
-PORTREVISION=	1
+PORTREVISION?=	2
 CATEGORIES?=	x11-toolkits
 MASTER_SITES=	ftp://ftp.trolltech.com/qt/source/ \
 		ftp://ftp.chg.ru/pub/X11/qt/source/
diff -urN /usr/ports/x11-toolkits/qt23/files/patch-src::tools::qeucjpcodec.cpp qt23/files/patch-src::tools::qeucjpcodec.cpp
--- /usr/ports/x11-toolkits/qt23/files/patch-src::tools::qeucjpcodec.cpp	Thu Jan  1 09:00:00 1970
+++ qt23/files/patch-src::tools::qeucjpcodec.cpp	Sun Mar  3 18:04:02 2002
@@ -0,0 +1,15 @@
+$FreeBSD$
+
+--- src/tools/qeucjpcodec.cpp.orig	Wed Jun 13 17:53:47 2001
++++ src/tools/qeucjpcodec.cpp	Sat Dec 22 20:55:38 2001
+@@ -317,8 +317,8 @@
+ 	}
+ 	// there exists ja_JP.EUC, ko_KR.EUC, zh_CN.EUC and zh_TW.EUC
+ 	// so "euc" may or may not be Japanese EUC.
+-	if (qstricmp(p, "euc") == 0) {
+-	    return ja ? score + 4 : 1;
++	if (qstricmp(p, "euc") == 0 && ja) {
++	    return score + 4;
+ 	}
+     }
+     return QTextCodec::heuristicNameMatch(hint);
diff -urN /usr/ports/x11-toolkits/qt23/files/patch-src::tools::qeuckrcodec.cpp qt23/files/patch-src::tools::qeuckrcodec.cpp
--- /usr/ports/x11-toolkits/qt23/files/patch-src::tools::qeuckrcodec.cpp	Thu Jan  1 09:00:00 1970
+++ qt23/files/patch-src::tools::qeuckrcodec.cpp	Sun Mar  3 18:04:36 2002
@@ -0,0 +1,15 @@
+$FreeBSD$
+
+--- src/tools/qeuckrcodec.cpp.orig	Wed Jun 13 17:53:47 2001
++++ src/tools/qeuckrcodec.cpp	Sat Dec 22 20:55:38 2001
+@@ -221,8 +221,8 @@
+     if (qstricmp(p, "eucKR") == 0) {
+       return score + 4;
+     }
+-    else if (qstricmp(p, "euc") == 0) {
+-      return ko ? score + 4 : 1;
++    else if (qstricmp(p, "euc") == 0 && ko) {
++      return score + 4;
+     }
+   }
+   return QTextCodec::heuristicNameMatch(hint);
diff -urN /usr/ports/x11-toolkits/qt23/files/patch-src::tools::qgbkcodec.cpp qt23/files/patch-src::tools::qgbkcodec.cpp
--- /usr/ports/x11-toolkits/qt23/files/patch-src::tools::qgbkcodec.cpp	Thu Jan  1 09:00:00 1970
+++ qt23/files/patch-src::tools::qgbkcodec.cpp	Sun Mar  3 18:12:05 2002
@@ -0,0 +1,20 @@
+$FreeBSD$
+
+--- src/tools/qgbkcodec.cpp.orig	Wed Jun 13 17:53:47 2001
++++ src/tools/qgbkcodec.cpp	Fri Mar  1 18:36:20 2002
+@@ -183,10 +183,13 @@
+     	p = hint;
+     }
+     if (p) {
+-    	if (qstricmp(p, "GBK") == 0)
+-      	    return score + 4;
++	if ((qstricmp(p, "GBK") == 0) ||
++	    (qstricmp(p, "eucCN") == 0))
++	    return score + 4;
+ 	else if (qstricmp(p, "GB2312") == 0)
+ 	    return score + 2;
++	else if (qstricmp(p, "euc") == 0 && zh)
++	    return score + 4;
+     }
+     return QTextCodec::heuristicNameMatch(hint);
+ }

>Release-Note:
>Audit-Trail:
>Unformatted:

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-ports" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20020311140642.5126CBAE7>