summaryrefslogtreecommitdiffstats
path: root/generic
diff options
context:
space:
mode:
authorjan.nijtmans <nijtmans@users.sourceforge.net>2019-12-11 08:52:58 (GMT)
committerjan.nijtmans <nijtmans@users.sourceforge.net>2019-12-11 08:52:58 (GMT)
commit1d6a94f9f809cab704789272afceeefb15e4b0db (patch)
tree33a4445ad9e5ef6f4bda3fd269d43550a25e030e /generic
parent86c130f239e17b4c14250bba02e65c9141daf99b (diff)
downloadtcl-1d6a94f9f809cab704789272afceeefb15e4b0db.zip
tcl-1d6a94f9f809cab704789272afceeefb15e4b0db.tar.gz
tcl-1d6a94f9f809cab704789272afceeefb15e4b0db.tar.bz2
Fix bug in tclEncoding.c, only manifesting in testcase encoding-15.4 for TCL_UTF_MAX=6. (knownBug, fixed now)
Diffstat (limited to 'generic')
-rw-r--r--generic/tclEncoding.c12
1 files changed, 3 insertions, 9 deletions
diff --git a/generic/tclEncoding.c b/generic/tclEncoding.c
index 0d03e2a..6740565 100644
--- a/generic/tclEncoding.c
+++ b/generic/tclEncoding.c
@@ -2418,16 +2418,10 @@ UtfToUtfProc(
*dst++ = (char) (((*chPtr >> 6) | 0x80) & 0xBF);
*dst++ = (char) ((*chPtr | 0x80) & 0xBF);
continue;
- } else if (TCL_UTF_MAX <= 4) {
- int full = (((*chPtr & 0x3FF) << 10) | (low & 0x3FF)) + 0x10000;
- *dst++ = (char) (((full >> 18) | 0xF0) & 0xF7);
- *dst++ = (char) (((full >> 12) | 0x80) & 0xBF);
- *dst++ = (char) (((full >> 6) | 0x80) & 0xBF);
- *dst++ = (char) ((full | 0x80) & 0xBF);
- *chPtr = 0;
- src += len;
- continue;
}
+ src += len;
+ dst += Tcl_UniCharToUtf(*chPtr, dst);
+ *chPtr = low;
}
dst += Tcl_UniCharToUtf(*chPtr, dst);
}