summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorapnadkarni <apnmbx-wits@yahoo.com>2023-07-05 03:23:43 (GMT)
committerapnadkarni <apnmbx-wits@yahoo.com>2023-07-05 03:23:43 (GMT)
commitb49afc700b71491f3ae17396d4ce473d4b067712 (patch)
treefdd48c0873f6225b68aef5415f0b836b9a9bbd49 /tests
parent3d2de6ed070b76c6a985c1cfe0be7a50fb12b650 (diff)
downloadtcl-b49afc700b71491f3ae17396d4ce473d4b067712.zip
tcl-b49afc700b71491f3ae17396d4ce473d4b067712.tar.gz
tcl-b49afc700b71491f3ae17396d4ce473d4b067712.tar.bz2
Bug [5be203d6ca] - better fix and add test
Diffstat (limited to 'tests')
-rw-r--r--tests/utfext.test8
1 files changed, 8 insertions, 0 deletions
diff --git a/tests/utfext.test b/tests/utfext.test
index bc996c9..a6c9dd8 100644
--- a/tests/utfext.test
+++ b/tests/utfext.test
@@ -93,6 +93,14 @@ test xx-bufferoverflow {buffer overflow Tcl_ExternalToUtf} -body {
# % testencoding Tcl_ExternalToUtf utf-8 abcdefgh {start end noterminate charlimit} {} 20 rv wv cv
# nospace {} abcÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ
+test TableToUtf-bug-5be203d6ca {Bug 5be203d6ca - truncated prefix in table encoding} -body {
+ set src \x82\x4f\x82\x50\x82
+ lassign [testencoding Tcl_ExternalToUtf shiftjis $src {start} 0 16 srcRead dstWritten charsWritten] buf
+ set result [list [testencoding Tcl_ExternalToUtf shiftjis $src {start} 0 16 srcRead dstWritten charsWritten] $srcRead $dstWritten $charsWritten]
+ lappend result {*}[list [testencoding Tcl_ExternalToUtf shiftjis [string range $src $srcRead end] {end} 0 10 srcRead dstWritten charsWritten] $srcRead $dstWritten $charsWritten]
+} -result [list [list multibyte 0 \xEF\xBC\x90\xEF\xBC\x91\x00\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF] 4 6 2 [list ok 0 \xC2\x82\x00\xFF\xFF\xFF\xFF\xFF\xFF\xFF] 1 2 1]
+
+
::tcltest::cleanupTests
return