diff options
| author | jan.nijtmans <nijtmans@users.sourceforge.net> | 2019-03-16 21:10:20 (GMT) |
|---|---|---|
| committer | jan.nijtmans <nijtmans@users.sourceforge.net> | 2019-03-16 21:10:20 (GMT) |
| commit | bc2c8431fc3b9961eabac2d1d2dd19f4325ce0a9 (patch) | |
| tree | fadd915985c2810d77c7d8558fe2d51260975db9 /generic/tclEncoding.c | |
| parent | 842878d2d0eee1bafcd57bc809ddac15b27c0510 (diff) | |
| parent | 2ff70c01f60ef1dbb586489d97b1f36368ad6741 (diff) | |
| download | tcl-bc2c8431fc3b9961eabac2d1d2dd19f4325ce0a9.zip tcl-bc2c8431fc3b9961eabac2d1d2dd19f4325ce0a9.tar.gz tcl-bc2c8431fc3b9961eabac2d1d2dd19f4325ce0a9.tar.bz2 | |
Merge 8.7
Move up some stub entries related to Tcl_UniChar
Use TCL_UTF_MAX=4 for full Unicode in stead of TCL_UTF_MAX=6 (TCL_UTF_MAX: 3 is default)
Diffstat (limited to 'generic/tclEncoding.c')
| -rw-r--r-- | generic/tclEncoding.c | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/generic/tclEncoding.c b/generic/tclEncoding.c index 0827907..3c73c68 100644 --- a/generic/tclEncoding.c +++ b/generic/tclEncoding.c @@ -1297,7 +1297,7 @@ Tcl_ExternalToUtf( if (*dstCharsPtr <= maxChars) { break; } - dstLen = Tcl_UtfAtIndex(dst, maxChars) - 1 - dst + TCL_UTF_MAX; + dstLen = Tcl_UtfAtIndex(dst, maxChars) - dst + (TCL_UTF_MAX - 1); flags = savedFlags; *statePtr = savedState; } while (1); @@ -2401,7 +2401,7 @@ UtfToUtfProc( int len = TclUtfToUniChar(src, chPtr); src += len; dst += Tcl_UniCharToUtf(*chPtr, dst); -#if TCL_UTF_MAX <= 4 +#if TCL_UTF_MAX == 3 if ((*chPtr >= 0xD800) && (len < 3)) { src += TclUtfToUniChar(src + len, chPtr); dst += Tcl_UniCharToUtf(*chPtr, dst); @@ -2590,7 +2590,7 @@ UtfToUtf16Proc( */ #ifdef WORDS_BIGENDIAN -#if TCL_UTF_MAX > 4 +#if TCL_UTF_MAX > 3 if (*chPtr <= 0xFFFF) { *dst++ = (*chPtr >> 8); *dst++ = (*chPtr & 0xFF); @@ -2605,7 +2605,7 @@ UtfToUtf16Proc( *dst++ = (*chPtr & 0xFF); #endif #else -#if TCL_UTF_MAX > 4 +#if TCL_UTF_MAX > 3 if (*chPtr <= 0xFFFF) { *dst++ = (*chPtr & 0xFF); *dst++ = (*chPtr >> 8); @@ -2673,7 +2673,7 @@ UtfToUcs2Proc( { const char *srcStart, *srcEnd, *srcClose, *dstStart, *dstEnd; int result, numChars; -#if TCL_UTF_MAX <= 4 +#if TCL_UTF_MAX == 3 int len; #endif Tcl_UniChar ch = 0; @@ -2703,7 +2703,7 @@ UtfToUcs2Proc( result = TCL_CONVERT_NOSPACE; break; } -#if TCL_UTF_MAX <= 4 +#if TCL_UTF_MAX == 3 src += (len = TclUtfToUniChar(src, &ch)); if ((ch >= 0xD800) && (len < 3)) { src += TclUtfToUniChar(src, &ch); @@ -2927,7 +2927,7 @@ TableFromUtfProc( } len = TclUtfToUniChar(src, &ch); -#if TCL_UTF_MAX > 4 +#if TCL_UTF_MAX > 3 /* * This prevents a crash condition. More evaluation is required for * full support of int Tcl_UniChar. [Bug 1004065] @@ -3138,7 +3138,7 @@ Iso88591FromUtfProc( */ if (ch > 0xff -#if TCL_UTF_MAX <= 4 +#if TCL_UTF_MAX == 3 || ((ch >= 0xD800) && (len < 3)) #endif ) { @@ -3146,7 +3146,7 @@ Iso88591FromUtfProc( result = TCL_CONVERT_UNKNOWN; break; } -#if TCL_UTF_MAX <= 4 +#if TCL_UTF_MAX == 3 if ((ch >= 0xD800) && (len < 3)) len = 4; #endif /* |
