Skip to content
Tcl Source Code View Ticket
Login

View Ticket

2014-02-21
19:11 • Ticket [3393714fff] overflow in toupper delta status still Open with 1 other... artifact: 6c39dcbd34 user: jan.nijtmans
19:05 • Ticket [3393714fff]: 1 change artifact: 4d7fb596bc user: jan.nijtmans
2011-12-08
22:57 • Ticket [3393714fff]: 4 changes artifact: e3bcaaf6f3 user: nijtmans
2011-08-18
18:40 • Ticket [3393714fff]: 4 changes artifact: 0b2ea63cdd user: nijtmans
09:28 • New ticket [3393714fff]. artifact: 212d363b15 user: nijtmans

overflow in toupper delta

Open3393714fffffffffffffffffffffffffffffffffCreated 15 years agoUpdated 13 years ago
Descriptionplain2011-08-18 09:28:33
From the Unicode table"
0265;LATIN SMALL LETTER TURNED H;Ll;0;L;;;;;N;;;A78D;;A78D
A78D;LATIN CAPITAL LETTER TURNED H;Lu;0;L;;;;;N;;;;0265;

This means that [string toupper \u0265 should give \uA78D, but
in the groups[] table (tclUniData.c) only 9 bits are reserved to
store the case delta. In thos case, we need 17 bits for
the delta (16 bits + sign bit)
nijtmansplain2011-08-18 18:40:41
Overflow problem fixed in all open branches.

However, there are 11 unicode characters in Unicode 6.0
(2 capital and 9 small letters), which have a 2-byte
UTF-8 representation for the original character but
a 3-byte representation for the converted character.
Currently the Tcl_UtfTo(Upper|Lower|Title) have
a protection to prevent inflation of the string,
which prevents the conversion in this case.

Here are the affected Unicode characters:
023A;LATIN CAPITAL LETTER A WITH STROKE;Lu;0;L;;;;;N;;;;2C65;
023E;LATIN CAPITAL LETTER T WITH DIAGONAL STROKE;Lu;0;L;;;;;N;;;;2C66;
023F;LATIN SMALL LETTER S WITH SWASH TAIL;Ll;0;L;;;;;N;;;2C7E;;2C7E
0240;LATIN SMALL LETTER Z WITH SWASH TAIL;Ll;0;L;;;;;N;;;2C7F;;2C7F
0250;LATIN SMALL LETTER TURNED A;Ll;0;L;;;;;N;;;2C6F;;2C6F
0251;LATIN SMALL LETTER ALPHA;Ll;0;L;;;;;N;LATIN SMALL LETTER SCRIPT A;;2C6D;;2C6D
0252;LATIN SMALL LETTER TURNED ALPHA;Ll;0;L;;;;;N;LATIN SMALL LETTER TURNED SCRIPT A;;2C70;;2C70
0265;LATIN SMALL LETTER TURNED H;Ll;0;L;;;;;N;;;A78D;;A78D
026B;LATIN SMALL LETTER L WITH MIDDLE TILDE;Ll;0;L;;;;;N;;;2C62;;2C62
0271;LATIN SMALL LETTER M WITH HOOK;Ll;0;L;;;;;N;LATIN SMALL LETTER M HOOK;;2C6E;;2C6E
027D;LATIN SMALL LETTER R WITH TAIL;Ll;0;L;;;;;N;LATIN SMALL LETTER R HOOK;;2C64;;2C64

For the first two capitals, [string tolower] will
result in the original characters. For the other
characters, [string toupper] and [string totitle]
give the wrong result.

Therefore this issue cannot be closed yet.
nijtmansplain2011-12-08 22:57:17
In Unicode 6.1, there will be one additional character
for which the same holds:

0266;LATIN SMALL LETTER H WITH HOOK;Ll;0;L;;;;;N;LATIN SMALL LETTER H HOOK;;A7AA;;A7AA
jan.nijtmans Ticket [3393714fff]: 1 change [History diff]2014-02-21 19:05:36
jan.nijtmans Ticket [3393714fff]: 1 change [History diff]2014-02-21 19:11:51
Log in (anonymous is fine) to add a comment.