diff options
author | jan.nijtmans <nijtmans@users.sourceforge.net> | 2019-11-13 09:07:08 (GMT) |
---|---|---|
committer | jan.nijtmans <nijtmans@users.sourceforge.net> | 2019-11-13 09:07:08 (GMT) |
commit | 3181ee9123bf2402abeba55ca2b9469d74382ed1 (patch) | |
tree | e190ea3271ffa636a77c3cb64a31af6f3ef8af0b | |
parent | de04d595faa9eff7914a831e767b11a2d5116b44 (diff) | |
download | tcl-3181ee9123bf2402abeba55ca2b9469d74382ed1.zip tcl-3181ee9123bf2402abeba55ca2b9469d74382ed1.tar.gz tcl-3181ee9123bf2402abeba55ca2b9469d74382ed1.tar.bz2 |
Fix TIP #389 implementation, bug [d433c0e0ad]: TCL_UTF_MAX == 4 problems. Thanks to Christian Werner for the report.
-rw-r--r-- | generic/tclEncoding.c | 2 | ||||
-rw-r--r-- | generic/tclInt.h | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/generic/tclEncoding.c b/generic/tclEncoding.c index 002c765..1c1f94c 100644 --- a/generic/tclEncoding.c +++ b/generic/tclEncoding.c @@ -2366,7 +2366,7 @@ UtfToUtfProc( dst += Tcl_UniCharToUtf(*chPtr, dst); #if TCL_UTF_MAX == 4 if ((*chPtr >= 0xD800) && (len < 3)) { - src += TclUtfToUniChar(src + len, chPtr); + src += Tcl_UtfToUniChar(src + len, chPtr); dst += Tcl_UniCharToUtf(*chPtr, dst); } #endif diff --git a/generic/tclInt.h b/generic/tclInt.h index 9038a56..39fb740 100644 --- a/generic/tclInt.h +++ b/generic/tclInt.h @@ -4429,7 +4429,7 @@ MODULE_SCOPE void TclDbInitNewObj(Tcl_Obj *objPtr, const char *file, */ #define TclUtfToUniChar(str, chPtr) \ - ((((unsigned char) *(str)) < 0xC0) ? \ + ((((unsigned char) *(str)) < 0x80) ? \ ((*(chPtr) = (unsigned char) *(str)), 1) \ : Tcl_UtfToUniChar(str, chPtr)) |