www.digitalmars.com         C & C++   DMDScript  

digitalmars.D - std.string.toupper/tolower failed with mixture of Engish and Chinese characters

reply Shawn Liu <Shawn_member pathlink.com> writes:
std.string.toupper() and std.string.tolower() give a wrong result when deal with
a mixture of upper/lower English and Chinese characters. e.g.
char[] a = "AbCdÖŠeFgH";
char[] b = std.string.toupper(a);
char[] c = std.string.tolower(a);

The length of a is 11, but the length of b,c is 18 now.
Nov 21 2005
next sibling parent reply "Kris" <fu bar.com> writes:
"Shawn Liu" <Shawn_member pathlink.com> wrote...
 std.string.toupper() and std.string.tolower() give a wrong result when 
 deal with
 a mixture of upper/lower English and Chinese characters. e.g.
 char[] a = "AbCdÖŠeFgH";
 char[] b = std.string.toupper(a);
 char[] c = std.string.tolower(a);

 The length of a is 11, but the length of b,c is 18 now.
Phobos doesn't supports non-ascii conversions/comparisons at this time?
Nov 21 2005
parent Thomas Kuehne <thomas-dloop kuehne.cn> writes:
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

[follow up set to: digitalmars.D.bugs]

Kris schrieb am 2005-11-22:
 "Shawn Liu" <Shawn_member pathlink.com> wrote...
 std.string.toupper() and std.string.tolower() give a wrong result when 
 deal with
 a mixture of upper/lower English and Chinese characters. e.g.
 char[] a = "AbCdÖŠeFgH";
 char[] b = std.string.toupper(a);
 char[] c = std.string.tolower(a);

 The length of a is 11, but the length of b,c is 18 now.
Phobos doesn't supports non-ascii conversions/comparisons at this time?
Phobos does, at least the simple conversions. No matter what cases are treated, the untreated data shouldn't get corrupted. The attached zipped string.d fixes toupper/tolower and extends the unittests. (Yes I know, it isn't the fastest possible algorithm ...) Thomas begin 644 string.d.zip M2;Q^3&8B*3D "4J008`!0$NRX_WMMQ[]Q(,$*28[<^\JL40"7=75W=75U=55 MU7_^T^Z]>W_^D[ GWF1)$)V+"R\:A_AA,H]&61!':1=?4Y&WL1C%LQL1)R** M,Y'QU[_0NQ\O_$AX&DIDWGL_A0<IH_7P\\Q+O*F?^4E;0"TB\;-Y$IE";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C`ZYU_)\%TDL>]M7;\/2UP/]NOS]GGD?%]68 M;_'-O"13"2<)'-,6<VYE E?F7,I(AYCH!F"/Q3Q%./?<FU<8+&_APC>9-T09 M:#V(W`>OWCA?C]^X]??*4-MY?[FD-!W8DKGL^A/94VL(%88M%RK**,=CIS?Z MO?P])?Q>;O*KWI[*_<&CBO?><+2L"+D4//SRD2K7?[C.E=;$SS\FJ`IBR*Z\ M\!A=BD$9FUT4K+-7\'3;CJ!7K(F"[5'/I,!$U^0 &G,8H$IX*E^ZSZL9W\G= M3\[<,B<J^GI$#C%RB%6J+C4G]U>_&2)(031EOLR.[=QH3'U4N/Z%B'(SNIE4 M;<8."V1B+.P.ANYT3!^V0*V0[.#BD"<QL):B:- O/N9^,/G+[7[ =TX_6`11 M/6X5HND VI&9TQC&E$M/-.'Z+F$2-73?DMTN3GA'/68%9&]M*;;23_(7X.0- MR26];FB0:I.I2')K2>)R*^6"PNB8U\WX6`?[]C`=V..D;\4HC%+5(%GM$V5] M7]G):2[GZF=[6E U;TQ/1(&U4*"31-/BO&%YG]D%&B`5AUC71%E/\?MX8A6W M8QMDYKH":'NOM0Q[6^SI"DXCIX8"R* `<QK!RA'5I6LX&B\ES"JC:X%G5B52 "```` ` end -----BEGIN PGP SIGNATURE----- iD8DBQFDiWW63w+/yD4P9tIRAoivAKCOEqwj78WeAvdHJXPVXnHfbidBhgCbBER5 ZJRVONC+QoNFxKQzvqWTDSQ= =ABr2 -----END PGP SIGNATURE-----
Nov 26 2005
prev sibling parent Derek Parnell <derek psych.ward> writes:
On Tue, 22 Nov 2005 02:19:50 +0000 (UTC), Shawn Liu wrote:

 std.string.toupper() and std.string.tolower() give a wrong result when deal
with
 a mixture of upper/lower English and Chinese characters. e.g.
 char[] a = "AbCdÖŠeFgH";
 char[] b = std.string.toupper(a);
 char[] c = std.string.tolower(a);
 
 The length of a is 11, but the length of b,c is 18 now.
If it isn't ASCII then DMD doesn't want to know about it. Try the Mango library for its ICU bindings, I think that might have it. -- Derek (skype: derek.j.parnell) Melbourne, Australia 22/11/2005 1:33:24 PM
Nov 21 2005