diff options
author | jan.nijtmans <nijtmans@users.sourceforge.net> | 2022-05-11 19:06:56 (GMT) |
---|---|---|
committer | jan.nijtmans <nijtmans@users.sourceforge.net> | 2022-05-11 19:06:56 (GMT) |
commit | 6d44e5c0f77c03a6daaf47db88c752018d980055 (patch) | |
tree | 8170cac008e068751bc51ec9fd0ffd6f4c1295a0 /library/http | |
parent | 0a5154ce87f664c62309803df4d7b8ab14b4721d (diff) | |
download | tcl-6d44e5c0f77c03a6daaf47db88c752018d980055.zip tcl-6d44e5c0f77c03a6daaf47db88c752018d980055.tar.gz tcl-6d44e5c0f77c03a6daaf47db88c752018d980055.tar.bz2 |
Fix [6898f9cb71]: shiftjis is presumably misspelled in http 2.7.7. Also add more testcases for http::CharsetToEncoding, revealing one more bug
Diffstat (limited to 'library/http')
-rw-r--r-- | library/http/http.tcl | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/library/http/http.tcl b/library/http/http.tcl index e754264..ae0a538 100644 --- a/library/http/http.tcl +++ b/library/http/http.tcl @@ -3479,7 +3479,7 @@ proc http::CharsetToEncoding {charset} { set encoding "iso8859-$num" } elseif {[regexp {iso-?2022-(jp|kr)} $charset -> ext]} { set encoding "iso2022-$ext" - } elseif {[regexp {shift[-_]?js} $charset]} { + } elseif {[regexp {shift[-_]?jis} $charset]} { set encoding "shiftjis" } elseif {[regexp {(?:windows|cp)-?([0-9]+)} $charset -> num]} { set encoding "cp$num" @@ -3491,6 +3491,9 @@ proc http::CharsetToEncoding {charset} { 1 - 2 - 3 { set encoding "iso8859-$num" } + default { + set encoding "binary" + } } } else { # other charset, like euc-xx, utf-8,... may directly map to encoding |