diff options
| author | jan.nijtmans <nijtmans@users.sourceforge.net> | 2023-05-01 19:42:53 (GMT) |
|---|---|---|
| committer | jan.nijtmans <nijtmans@users.sourceforge.net> | 2023-05-01 19:42:53 (GMT) |
| commit | 190852002f644f02a6e13c6a7c9017c3f21e1003 (patch) | |
| tree | bed7c42f0cd850e442f6cc56d59c3b6b5efe258a /generic/tclUtil.c | |
| parent | 6c4b78cfa8c06ea5963591778902da74850d1985 (diff) | |
| download | tcl-190852002f644f02a6e13c6a7c9017c3f21e1003.zip tcl-190852002f644f02a6e13c6a7c9017c3f21e1003.tar.gz tcl-190852002f644f02a6e13c6a7c9017c3f21e1003.tar.bz2 | |
Remove internal use of TCL_UTF_MAX=3 as much as possible, without compromizing existing TIP's
Diffstat (limited to 'generic/tclUtil.c')
| -rw-r--r-- | generic/tclUtil.c | 30 |
1 files changed, 15 insertions, 15 deletions
diff --git a/generic/tclUtil.c b/generic/tclUtil.c index 7bd55e2..09806b5 100644 --- a/generic/tclUtil.c +++ b/generic/tclUtil.c @@ -1717,7 +1717,7 @@ TclTrimRight( pp = Tcl_UtfPrev(p, bytes); do { pp += pInc; - pInc = TclUtfToUCS4(pp, &ch1); + pInc = Tcl_UtfToUniChar(pp, &ch1); } while (pp + pInc < p); /* @@ -1725,7 +1725,7 @@ TclTrimRight( */ do { - pInc = TclUtfToUCS4(q, &ch2); + pInc = Tcl_UtfToUniChar(q, &ch2); if (ch1 == ch2) { break; @@ -1790,7 +1790,7 @@ TclTrimLeft( */ do { - int pInc = TclUtfToUCS4(p, &ch1); + int pInc = Tcl_UtfToUniChar(p, &ch1); const char *q = trim; int bytesLeft = numTrim; @@ -1799,7 +1799,7 @@ TclTrimLeft( */ do { - int qInc = TclUtfToUCS4(q, &ch2); + int qInc = Tcl_UtfToUniChar(q, &ch2); if (ch1 == ch2) { break; @@ -1866,7 +1866,7 @@ TclTrim( if (numBytes > 0) { int ch; const char *first = bytes + trimLeft; - bytes += TclUtfToUCS4(first, &ch); + bytes += Tcl_UtfToUniChar(first, &ch); numBytes -= (bytes - first); if (numBytes > 0) { @@ -2220,7 +2220,7 @@ Tcl_StringCaseMatch( ch2 = (int) (nocase ? tolower(UCHAR(*pattern)) : UCHAR(*pattern)); } else { - TclUtfToUCS4(pattern, &ch2); + Tcl_UtfToUniChar(pattern, &ch2); if (nocase) { ch2 = Tcl_UniCharToLower(ch2); } @@ -2236,7 +2236,7 @@ Tcl_StringCaseMatch( if ((p != '[') && (p != '?') && (p != '\\')) { if (nocase) { while (*str) { - charLen = TclUtfToUCS4(str, &ch1); + charLen = Tcl_UtfToUniChar(str, &ch1); if (ch2==ch1 || ch2==Tcl_UniCharToLower(ch1)) { break; } @@ -2250,7 +2250,7 @@ Tcl_StringCaseMatch( */ while (*str) { - charLen = TclUtfToUCS4(str, &ch1); + charLen = Tcl_UtfToUniChar(str, &ch1); if (ch2 == ch1) { break; } @@ -2264,7 +2264,7 @@ Tcl_StringCaseMatch( if (*str == '\0') { return 0; } - str += TclUtfToUCS4(str, &ch1); + str += Tcl_UtfToUniChar(str, &ch1); } } @@ -2275,7 +2275,7 @@ Tcl_StringCaseMatch( if (p == '?') { pattern++; - str += TclUtfToUCS4(str, &ch1); + str += Tcl_UtfToUniChar(str, &ch1); continue; } @@ -2294,7 +2294,7 @@ Tcl_StringCaseMatch( (nocase ? tolower(UCHAR(*str)) : UCHAR(*str)); str++; } else { - str += TclUtfToUCS4(str, &ch1); + str += Tcl_UtfToUniChar(str, &ch1); if (nocase) { ch1 = Tcl_UniCharToLower(ch1); } @@ -2308,7 +2308,7 @@ Tcl_StringCaseMatch( ? tolower(UCHAR(*pattern)) : UCHAR(*pattern)); pattern++; } else { - pattern += TclUtfToUCS4(pattern, &startChar); + pattern += Tcl_UtfToUniChar(pattern, &startChar); if (nocase) { startChar = Tcl_UniCharToLower(startChar); } @@ -2323,7 +2323,7 @@ Tcl_StringCaseMatch( ? tolower(UCHAR(*pattern)) : UCHAR(*pattern)); pattern++; } else { - pattern += TclUtfToUCS4(pattern, &endChar); + pattern += Tcl_UtfToUniChar(pattern, &endChar); if (nocase) { endChar = Tcl_UniCharToLower(endChar); } @@ -2371,8 +2371,8 @@ Tcl_StringCaseMatch( * each string match. */ - str += TclUtfToUCS4(str, &ch1); - pattern += TclUtfToUCS4(pattern, &ch2); + str += Tcl_UtfToUniChar(str, &ch1); + pattern += Tcl_UtfToUniChar(pattern, &ch2); if (nocase) { if (Tcl_UniCharToLower(ch1) != Tcl_UniCharToLower(ch2)) { return 0; |
