summaryrefslogtreecommitdiffstats
path: root/generic/tclEncoding.c
diff options
context:
space:
mode:
authorjan.nijtmans <nijtmans@users.sourceforge.net>2024-02-08 13:21:02 (GMT)
committerjan.nijtmans <nijtmans@users.sourceforge.net>2024-02-08 13:21:02 (GMT)
commit72b48ad09d29a1b9d10b27d083476beb73b985b1 (patch)
treecad2fc921cad6a2cce38947e7a0f2253547c021d /generic/tclEncoding.c
parent6b0a2258a776aa502a25b2e6e568439296cd8ec8 (diff)
downloadtcl-72b48ad09d29a1b9d10b27d083476beb73b985b1.zip
tcl-72b48ad09d29a1b9d10b27d083476beb73b985b1.tar.gz
tcl-72b48ad09d29a1b9d10b27d083476beb73b985b1.tar.bz2
Fix all 'ascii' testcases in encodingVectors.tcl, another try. See [1355b9a874].
Diffstat (limited to 'generic/tclEncoding.c')
-rw-r--r--generic/tclEncoding.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/generic/tclEncoding.c b/generic/tclEncoding.c
index 727ed89..ba36f55 100644
--- a/generic/tclEncoding.c
+++ b/generic/tclEncoding.c
@@ -3387,6 +3387,7 @@ TableToUtfProc(
} else if (PROFILE_REPLACE(flags)) {
ch = UNICODE_REPLACE_CHAR;
} else {
+ /* For prefix bytes, we don't fallback to cp1252, see [1355b9a874] */
ch = (Tcl_UniChar)byte;
}
} else {
@@ -3407,7 +3408,9 @@ TableToUtfProc(
if (PROFILE_REPLACE(flags)) {
ch = UNICODE_REPLACE_CHAR;
} else {
- ch = (Tcl_UniChar)byte;
+ char chbuf[2];
+ chbuf[0] = byte; chbuf[1] = 0;
+ Tcl_UtfToUniChar(chbuf, &ch);
}
}