mldonkey-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Mldonkey-commits] mldonkey distrib/ChangeLog src/utils/lib/charse...


From: mldonkey-commits
Subject: [Mldonkey-commits] mldonkey distrib/ChangeLog src/utils/lib/charse...
Date: Thu, 14 Sep 2006 17:40:29 +0000

CVSROOT:        /sources/mldonkey
Module name:    mldonkey
Changes by:     spiralvoice <spiralvoice>       06/09/14 17:40:29

Modified files:
        distrib        : ChangeLog 
        src/utils/lib  : charset.ml 

Log message:
        patch #5390

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/mldonkey/distrib/ChangeLog?cvsroot=mldonkey&r1=1.1004&r2=1.1005
http://cvs.savannah.gnu.org/viewcvs/mldonkey/src/utils/lib/charset.ml?cvsroot=mldonkey&r1=1.6&r2=1.7

Patches:
Index: distrib/ChangeLog
===================================================================
RCS file: /sources/mldonkey/mldonkey/distrib/ChangeLog,v
retrieving revision 1.1004
retrieving revision 1.1005
diff -u -b -r1.1004 -r1.1005
--- distrib/ChangeLog   14 Sep 2006 17:34:34 -0000      1.1004
+++ distrib/ChangeLog   14 Sep 2006 17:40:28 -0000      1.1005
@@ -15,6 +15,7 @@
 =========
 
 2006/09/14
+5390: Distinguish between charsets zh_cn and zh_tw
 5389: Fix verify_chunks (pango)
 5388: Small log update
 

Index: src/utils/lib/charset.ml
===================================================================
RCS file: /sources/mldonkey/mldonkey/src/utils/lib/charset.ml,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -b -r1.6 -r1.7
--- src/utils/lib/charset.ml    19 Nov 2005 17:19:45 -0000      1.6
+++ src/utils/lib/charset.ml    14 Sep 2006 17:40:29 -0000      1.7
@@ -172,7 +172,7 @@
 
(**********************************************************************************)
 
 (* taken from camomile *)
-(* $Id: charset.ml,v 1.6 2005/11/19 17:19:45 spiralvoice Exp $ *)
+(* $Id: charset.ml,v 1.7 2006/09/14 17:40:29 spiralvoice Exp $ *)
 (* Copyright 2002, 2003 Yamagata Yoriyuki. distributed with LGPL *)
 
 let utf8_look s i =
@@ -254,7 +254,7 @@
 
(**********************************************************************************)
 
 (* taken from camomile *)
-(* $Id: charset.ml,v 1.6 2005/11/19 17:19:45 spiralvoice Exp $ *)
+(* $Id: charset.ml,v 1.7 2006/09/14 17:40:29 spiralvoice Exp $ *)
 (* Copyright 2002, 2003 Yamagata Yoriyuki. distributed with LGPL *)
 
 let rec length_aux s c i =
@@ -281,7 +281,7 @@
 
 
 (* taken from camomile *)
-(* $Id: charset.ml,v 1.6 2005/11/19 17:19:45 spiralvoice Exp $ *)
+(* $Id: charset.ml,v 1.7 2006/09/14 17:40:29 spiralvoice Exp $ *)
 (* Copyright 2002, 2003 Yamagata Yoriyuki. distributed with LGPL *)
 
 external uint_code : uchar -> int = "%identity"
@@ -1303,10 +1303,15 @@
 
(**********************************************************************************)
 
 let normalize_language s =
+  let s = String.uppercase s in
   if String.length s > 1
   then begin
-    let s = String.sub s 0 2 in
-    String.uppercase s
+(* We have to distinguish between ZH_tw and ZH_cn here
+   ZH_tw = BIG5/Chinese traditional -- ZH_cn = GBK/Chinese simplified *)
+    if String.sub s 0 2 = "ZH" && String.length s > 4 then
+      String.sub s 0 5
+    else
+      String.sub s 0 2
   end else "EN"
 
 
(**********************************************************************************)
@@ -1726,6 +1731,8 @@
       | "SL" -> li := central_european :: !li
       | "SH"
       | "SR" -> li := central_european :: cyrillic ::!li
+      | "ZH_CN" -> li := chinese_simplified :: !li
+      | "ZH_TW" -> li := chinese_traditional :: !li
       | "ZH" -> li := chinese_traditional :: chinese_simplified :: !li
       | "BE"
       | "BG"




reply via email to

[Prev in Thread] Current Thread [Next in Thread]