diff options
| author | Lars Ingebrigtsen | 2015-12-28 02:57:40 +0100 |
|---|---|---|
| committer | Lars Ingebrigtsen | 2015-12-28 02:57:40 +0100 |
| commit | 1f591ca64f2409b4c44d7ff239f95bcfa1a568aa (patch) | |
| tree | 3abebc632bc304c303e8d3fdbc7a812535141226 | |
| parent | bd892f033229d13a7f84e45906c070c052d4b1ae (diff) | |
| download | emacs-1f591ca64f2409b4c44d7ff239f95bcfa1a568aa.tar.gz emacs-1f591ca64f2409b4c44d7ff239f95bcfa1a568aa.zip | |
Further IDNA tweaks
(idna-encode-string): Make idna-encode-string safe for
non-ASCII use.
| -rw-r--r-- | lisp/net/idna.el | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/lisp/net/idna.el b/lisp/net/idna.el index f34fb9c490a..dfaf711c71e 100644 --- a/lisp/net/idna.el +++ b/lisp/net/idna.el | |||
| @@ -33,7 +33,9 @@ | |||
| 33 | (let ((ascii (seq-filter (lambda (char) | 33 | (let ((ascii (seq-filter (lambda (char) |
| 34 | (< char 128)) | 34 | (< char 128)) |
| 35 | string))) | 35 | string))) |
| 36 | (concat "xn--" ascii "-" (idna-encode-complex (length ascii) string)))) | 36 | (if (= (length ascii) (length string)) |
| 37 | string | ||
| 38 | (concat "xn--" ascii "-" (idna-encode-complex (length ascii) string))))) | ||
| 37 | 39 | ||
| 38 | (defconst idna-initial-n 128) | 40 | (defconst idna-initial-n 128) |
| 39 | (defconst idna-initial-bias 72) | 41 | (defconst idna-initial-bias 72) |