summaryrefslogtreecommitdiffstats
path: root/library
diff options
context:
space:
mode:
authorjan.nijtmans <nijtmans@users.sourceforge.net>2023-04-01 08:42:01 (GMT)
committerjan.nijtmans <nijtmans@users.sourceforge.net>2023-04-01 08:42:01 (GMT)
commit2a8ae1943e110496441be0bfd15babe61955c1d3 (patch)
treee6ad82c03b3baba2fcb5c4d13bed89f724a37448 /library
parent4f5c603784f1edcf014c802f68d84f7e98c55efe (diff)
parentce04b407d9ed313df659f9d292b91ca65f3e82c4 (diff)
downloadtcl-2a8ae1943e110496441be0bfd15babe61955c1d3.zip
tcl-2a8ae1943e110496441be0bfd15babe61955c1d3.tar.gz
tcl-2a8ae1943e110496441be0bfd15babe61955c1d3.tar.bz2
Merge 9.0
Diffstat (limited to 'library')
-rw-r--r--library/tcltest/tcltest.tcl13
1 files changed, 6 insertions, 7 deletions
diff --git a/library/tcltest/tcltest.tcl b/library/tcltest/tcltest.tcl
index 278a4e0..6a161a3 100644
--- a/library/tcltest/tcltest.tcl
+++ b/library/tcltest/tcltest.tcl
@@ -1152,15 +1152,14 @@ proc tcltest::SafeFetch {n1 n2 op} {
proc tcltest::Asciify {s} {
set print ""
foreach c [split $s ""] {
- set i [scan $c %c]
- if {[string is print $c] && ($i <= 127)} {
+ if {[string is print $c] && (($c <= "\x7E") || ($c == "\n"))} {
append print $c
- } elseif {$i <= 0xFF} {
- append print \\x[format %02X $i]
- } elseif {$i <= 0xFFFF} {
- append print \\u[format %04X $i]
+ } elseif {$c <= "\xFF"} {
+ append print \\x[format %02X [scan $c %c]]
+ } elseif {$c <= "\xFFFF"} {
+ append print \\u[format %04X [scan $c %c]]
} else {
- append print \\U[format %08X $i]
+ append print \\U[format %08X [scan $c %c]]
}
}
return $print