summaryrefslogtreecommitdiffstats
path: root/library/http
diff options
context:
space:
mode:
authordkf <donal.k.fellows@manchester.ac.uk>2018-10-14 10:51:27 (GMT)
committerdkf <donal.k.fellows@manchester.ac.uk>2018-10-14 10:51:27 (GMT)
commit239ba78ee454f3184deca7019c7bb76c8a1d0cde (patch)
tree5fe325a1063198646279a962f6b1def418d7e25f /library/http
parent359b371edd4b8a1b17f304f27fb30c89ad9ae8b0 (diff)
downloadtcl-239ba78ee454f3184deca7019c7bb76c8a1d0cde.zip
tcl-239ba78ee454f3184deca7019c7bb76c8a1d0cde.tar.gz
tcl-239ba78ee454f3184deca7019c7bb76c8a1d0cde.tar.bz2
Adapt the code to the fact that we don't need to stick to the BMP any more
Diffstat (limited to 'library/http')
-rw-r--r--library/http/idna.tcl7
1 files changed, 3 insertions, 4 deletions
diff --git a/library/http/idna.tcl b/library/http/idna.tcl
index 53e45ca..030ed82 100644
--- a/library/http/idna.tcl
+++ b/library/http/idna.tcl
@@ -66,9 +66,7 @@ namespace eval ::tcl::idna {
variable initial_bias 72
variable initial_n 0x80
- variable max_codepoint 0xFFFF ;# 0x10FFFF would be correct, except Tcl
- # can't handle non-BMP characters right now
- # anyway.
+ variable max_codepoint 0x10FFFF
proc adapt {delta first numchars} {
variable base
@@ -263,7 +261,8 @@ namespace eval ::tcl::idna {
throw {PUNYCODE OVERFLOW} \
"excessively large integer computed in character choice"
} elseif {$n > $max_codepoint} {
- if {$n < 0x10ffff} {
+ if {$n >= 0x00d800 && $n < 0x00e000} {
+ # Bare surrogate?!
throw {PUNYCODE NON_BMP} \
[format "unsupported character U+%06x" $n]
}