diff options
author | jan.nijtmans <nijtmans@users.sourceforge.net> | 2019-09-16 21:35:16 (GMT) |
---|---|---|
committer | jan.nijtmans <nijtmans@users.sourceforge.net> | 2019-09-16 21:35:16 (GMT) |
commit | 6d451c02f28c0d55838618ed69154a0bce0f3eda (patch) | |
tree | 0fd7140b53ff1b2b920f6a80cbc79523009362e5 /generic/tclUtf.c | |
parent | fab75817f4590891d03d35e5d64e907c3e99ce20 (diff) | |
parent | caa904131ac249bfd2991302520766b895bcf9a7 (diff) | |
download | tcl-6d451c02f28c0d55838618ed69154a0bce0f3eda.zip tcl-6d451c02f28c0d55838618ed69154a0bce0f3eda.tar.gz tcl-6d451c02f28c0d55838618ed69154a0bce0f3eda.tar.bz2 |
Merge 8.6
Diffstat (limited to 'generic/tclUtf.c')
-rw-r--r-- | generic/tclUtf.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/generic/tclUtf.c b/generic/tclUtf.c index 320d7aa..7404663 100644 --- a/generic/tclUtf.c +++ b/generic/tclUtf.c @@ -332,7 +332,7 @@ Tcl_Char16ToUtfDString( * Tcl_UtfCharComplete() before calling this routine to ensure that * enough bytes remain in the string. * - * Special handling of Surrogate pairs is handled as follows: + * If TCL_UTF_MAX <= 4, special handling of Surrogate pairs is done: * For any UTF-8 string containing a character outside of the BMP, the * first call to this function will fill *chPtr with the high surrogate * and generate a return value of 1. Calling Tcl_UtfToUniChar again @@ -788,7 +788,7 @@ Tcl_UtfFindFirst( len = TclUtfToUniChar(src, &find); fullchar = find; #if TCL_UTF_MAX <= 4 - if ((ch >= 0xD800) && (len < 3)) { + if ((fullchar != ch) && (find >= 0xD800) && (len < 3)) { len += TclUtfToUniChar(src + len, &find); fullchar = (((fullchar & 0x3ff) << 10) | (find & 0x3ff)) + 0x10000; } @@ -836,7 +836,7 @@ Tcl_UtfFindLast( len = TclUtfToUniChar(src, &find); fullchar = find; #if TCL_UTF_MAX <= 4 - if ((ch >= 0xD800) && (len < 3)) { + if ((fullchar != ch) && (find >= 0xD800) && (len < 3)) { len += TclUtfToUniChar(src + len, &find); fullchar = (((fullchar & 0x3ff) << 10) | (find & 0x3ff)) + 0x10000; } |