emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] master 341feb3 3/6: Fix puny-encoding all-non-ASCII domain


From: Lars Ingebrigtsen
Subject: [Emacs-diffs] master 341feb3 3/6: Fix puny-encoding all-non-ASCII domains
Date: Mon, 28 Dec 2015 23:11:54 +0000

branch: master
commit 341feb3a26a0277f535217f4919b23eb70e3680e
Author: Lars Ingebrigtsen <address@hidden>
Commit: Lars Ingebrigtsen <address@hidden>

    Fix puny-encoding all-non-ASCII domains
    
    * puny.el (puny-encode-string): Fix the all-non-ASCII encoding case.
---
 lisp/net/puny.el |    6 +++++-
 1 files changed, 5 insertions(+), 1 deletions(-)

diff --git a/lisp/net/puny.el b/lisp/net/puny.el
index a16e3a0..d96c6c2 100644
--- a/lisp/net/puny.el
+++ b/lisp/net/puny.el
@@ -47,7 +47,11 @@ For instance, \"bücher\" => \"xn--bcher-kva\"."
                            string)))
     (if (= (length ascii) (length string))
         string
-      (concat "xn--" ascii "-" (puny-encode-complex (length ascii) string)))))
+      (concat "xn--"
+              (if (null ascii)
+                  ""
+                (concat ascii "-"))
+              (puny-encode-complex (length ascii) string)))))
 
 (defun puny-decode-domain (domain)
   "Decode DOMAIN according to the IDNA/punycode algorith.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]