summaryrefslogtreecommitdiffstats
path: root/generic/tclUtf.c
diff options
context:
space:
mode:
authorjan.nijtmans <nijtmans@users.sourceforge.net>2020-04-29 19:20:18 (GMT)
committerjan.nijtmans <nijtmans@users.sourceforge.net>2020-04-29 19:20:18 (GMT)
commit55792c9370ff237864d73351b01a01c52ca7f9e5 (patch)
treecf4c7a3395ee28b83b95fbaa4695ab5c7ab50fe6 /generic/tclUtf.c
parent3f01cc8310e47f5510f89433b511863751e92c3a (diff)
parente75fc19d85ecc92ab5b33dcc23d2a50a57c0d7b1 (diff)
downloadtcl-55792c9370ff237864d73351b01a01c52ca7f9e5.zip
tcl-55792c9370ff237864d73351b01a01c52ca7f9e5.tar.gz
tcl-55792c9370ff237864d73351b01a01c52ca7f9e5.tar.bz2
Merge-mark 8.6 (Use of UNICODE_OUT_OF_RANGE() macro already was in 8.7).
Quick exit from Tcl_UtfToChar16()/Tcl_UtfToUniChar() when lead-byte is 0xF5 - 0xF7.
Diffstat (limited to 'generic/tclUtf.c')
-rw-r--r--generic/tclUtf.c17
1 files changed, 6 insertions, 11 deletions
diff --git a/generic/tclUtf.c b/generic/tclUtf.c
index 19e1365..dc028f7 100644
--- a/generic/tclUtf.c
+++ b/generic/tclUtf.c
@@ -96,11 +96,6 @@ static const unsigned char complete[256] = {
*/
static int Invalid(unsigned char *src);
-
-#define UCS4ToUpper Tcl_UniCharToUpper
-#define UCS4ToLower Tcl_UniCharToLower
-#define UCS4ToTitle Tcl_UniCharToTitle
-
/*
*---------------------------------------------------------------------------
@@ -502,7 +497,7 @@ Tcl_UtfToUniChar(
* represents itself.
*/
}
- else if (byte < 0xF8) {
+ else if (byte < 0xF5) {
if (((src[1] & 0xC0) == 0x80) && ((src[2] & 0xC0) == 0x80) && ((src[3] & 0xC0) == 0x80)) {
/*
* Four-byte-character lead byte followed by three trail bytes.
@@ -598,7 +593,7 @@ Tcl_UtfToChar16(
* represents itself.
*/
}
- else if (byte < 0xF8) {
+ else if (byte < 0xF5) {
if (((src[1] & 0xC0) == 0x80) && ((src[2] & 0xC0) == 0x80) && ((src[3] & 0xC0) == 0x80)) {
/*
* Four-byte-character lead byte followed by three trail bytes.
@@ -1235,7 +1230,7 @@ Tcl_UtfToUpper(
src = dst = str;
while (*src) {
len = TclUtfToUCS4(src, &ch);
- upChar = UCS4ToUpper(ch);
+ upChar = Tcl_UniCharToUpper(ch);
/*
* To keep badly formed Utf strings from getting inflated by the
@@ -1288,7 +1283,7 @@ Tcl_UtfToLower(
src = dst = str;
while (*src) {
len = TclUtfToUCS4(src, &ch);
- lowChar = UCS4ToLower(ch);
+ lowChar = Tcl_UniCharToLower(ch);
/*
* To keep badly formed Utf strings from getting inflated by the
@@ -1344,7 +1339,7 @@ Tcl_UtfToTitle(
if (*src) {
len = TclUtfToUCS4(src, &ch);
- titleChar = UCS4ToTitle(ch);
+ titleChar = Tcl_UniCharToTitle(ch);
if ((len < TclUtfCount(titleChar)) || ((titleChar & 0xF800) == 0xD800)) {
memmove(dst, src, len);
@@ -1359,7 +1354,7 @@ Tcl_UtfToTitle(
lowChar = ch;
/* Special exception for Georgian Asomtavruli chars, no titlecase. */
if ((unsigned)(lowChar - 0x1C90) >= 0x30) {
- lowChar = UCS4ToLower(lowChar);
+ lowChar = Tcl_UniCharToLower(lowChar);
}
if ((len < TclUtfCount(lowChar)) || ((lowChar & 0xF800) == 0xD800)) {