From b1517df3ff0aa3be2bb952a719ffbbc27d69e226 Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Thu, 3 Dec 2020 09:09:25 +0000 Subject: Simplify some \\u???? escape sequences to \\x?? --- library/cookiejar/cookiejar.tcl | 6 +++--- library/cookiejar/idna.tcl | 8 ++++---- tools/makeHeader.tcl | 2 +- tools/regexpTestLib.tcl | 2 +- tools/tcltk-man2html-utils.tcl | 8 ++++---- 5 files changed, 13 insertions(+), 13 deletions(-) diff --git a/library/cookiejar/cookiejar.tcl b/library/cookiejar/cookiejar.tcl index 6c8e82b..cfa73ae 100644 --- a/library/cookiejar/cookiejar.tcl +++ b/library/cookiejar/cookiejar.tcl @@ -132,7 +132,7 @@ package provide cookiejar \ # The implementation of the cookiejar package ::oo::define ::http::cookiejar { self { - method configure {{optionName "\u0000\u0000"} {optionValue "\u0000\u0000"}} { + method configure {{optionName "\x00\x00"} {optionValue "\x00\x00"}} { set tbl { -domainfile {domainfile set} -domainlist {domainlist set} @@ -149,14 +149,14 @@ package provide cookiejar \ dict lappend tbl -purgeold [namespace code { my IntervalTrigger PostponePurge }] - if {$optionName eq "\u0000\u0000"} { + if {$optionName eq "\x00\x00"} { return [dict keys $tbl] } set opt [::tcl::prefix match -message "option" \ [dict keys $tbl] $optionName] set setter [lassign [dict get $tbl $opt] varname] namespace upvar [namespace current] $varname var - if {$optionValue ne "\u0000\u0000"} { + if {$optionValue ne "\x00\x00"} { {*}$setter var $optionValue } return $var diff --git a/library/cookiejar/idna.tcl b/library/cookiejar/idna.tcl index 88c2b9d..658dcd6 100644 --- a/library/cookiejar/idna.tcl +++ b/library/cookiejar/idna.tcl @@ -27,9 +27,9 @@ namespace eval ::tcl::idna { proc IDNAencode hostname { set parts {} # Split term from RFC 3490, Sec 3.1 - foreach part [split $hostname "\u002E\u3002\uFF0E\uFF61"] { + foreach part [split $hostname "\x2E\u3002\uFF0E\uFF61"] { if {[regexp {[^-A-Za-z0-9]} $part]} { - if {[regexp {[^-A-Za-z0-9\u00a1-\uffff]} $part ch]} { + if {[regexp {[^-A-Za-z0-9\xA1-\uFFFF]} $part ch]} { scan $ch %c c if {$ch < "!" || $ch > "~"} { set ch [format "\\u%04x" $c] @@ -51,7 +51,7 @@ namespace eval ::tcl::idna { proc IDNAdecode hostname { set parts {} # Split term from RFC 3490, Sec 3.1 - foreach part [split $hostname "\u002E\u3002\uFF0E\uFF61"] { + foreach part [split $hostname "\x2E\u3002\uFF0E\uFF61"] { if {[string match -nocase "xn--*" $part]} { set part [punydecode [string range $part 4 end]] } @@ -116,7 +116,7 @@ namespace eval ::tcl::idna { # Handle the basic code points: foreach ch $string { - if {$ch < "\u0080"} { + if {$ch < "\x80"} { if {$case eq ""} { append output $ch } elseif {[string is true $case]} { diff --git a/tools/makeHeader.tcl b/tools/makeHeader.tcl index dd2f199..c72219f 100644 --- a/tools/makeHeader.tcl +++ b/tools/makeHeader.tcl @@ -25,7 +25,7 @@ namespace eval makeHeader { } set XFORM {[format \\\\\\\\u%04x {*}[scan & %c]]} - subst [regsub -all {[^\u0020-\u007e]} [string map $MAP $str] $XFORM] + subst [regsub -all {[^\x20-\x7E]} [string map $MAP $str] $XFORM] } #################################################################### diff --git a/tools/regexpTestLib.tcl b/tools/regexpTestLib.tcl index a94d90f..bdb7d90 100644 --- a/tools/regexpTestLib.tcl +++ b/tools/regexpTestLib.tcl @@ -192,7 +192,7 @@ proc convertTestLine {currentLine len lineNum srcLineNum} { # if and \r substitutions are made, do not wrap re, flags, # str, and result in braces - set noBraces [regsub -all {R} $currentLine {\\\u000D} currentLine] + set noBraces [regsub -all {R} $currentLine {\\\x0D} currentLine] regsub -all {T} $currentLine {\\t} currentLine regsub -all {V} $currentLine {\\v} currentLine if {[regexp {=} $flags] == 1} { diff --git a/tools/tcltk-man2html-utils.tcl b/tools/tcltk-man2html-utils.tcl index 94440d5..2d82bb1 100644 --- a/tools/tcltk-man2html-utils.tcl +++ b/tools/tcltk-man2html-utils.tcl @@ -130,8 +130,8 @@ proc htmlize-text {text {charmap {}}} { \" {"} \ {<} {<} \ {>} {>} \ - \u201c "“" \ - \u201d "”" + \u201C "“" \ + \u201D "”" return [string map $charmap $text] } @@ -1303,8 +1303,8 @@ proc make-manpage-section {outputDir sectionDescriptor} { global manual overall_title tcltkdesc verbose global excluded_pages forced_index_pages process_first_patterns - set LQ \u201c - set RQ \u201d + set LQ \u201C + set RQ \u201D lassign $sectionDescriptor \ manual(wing-glob) \ -- cgit v0.12