summaryrefslogtreecommitdiffstats
path: root/generic
diff options
context:
space:
mode:
authorjan.nijtmans <nijtmans@users.sourceforge.net>2023-01-28 18:50:32 (GMT)
committerjan.nijtmans <nijtmans@users.sourceforge.net>2023-01-28 18:50:32 (GMT)
commit468b1a434681f98ea64d399abce7ddd8c605617d (patch)
tree5b0780a8104388c5d245fc2b035f1c3e85f94887 /generic
parent5d13f6b52781e4d4f0063f4df3f25cce990f6697 (diff)
downloadtcl-468b1a434681f98ea64d399abce7ddd8c605617d.zip
tcl-468b1a434681f98ea64d399abce7ddd8c605617d.tar.gz
tcl-468b1a434681f98ea64d399abce7ddd8c605617d.tar.bz2
Fix "format %c 0x10000041", should give the same answer as in Tcl 8.6 (Handling of TCL_COMBINE flag should not be visible at script level)
Diffstat (limited to 'generic')
-rw-r--r--generic/tclStringObj.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/generic/tclStringObj.c b/generic/tclStringObj.c
index a041d4c..e1376f4 100644
--- a/generic/tclStringObj.c
+++ b/generic/tclStringObj.c
@@ -2130,6 +2130,9 @@ Tcl_AppendFormatToObj(
if (TclGetIntFromObj(interp, segment, &code) != TCL_OK) {
goto error;
}
+ if ((unsigned)code > 0x10FFFF) {
+ code = 0xFFFD;
+ }
length = Tcl_UniCharToUtf(code, buf);
#if TCL_UTF_MAX < 4
if ((code >= 0xD800) && (length < 3)) {