message.el (message-use-idna): Disable if UTF-8 unavailable.
authorSimon Josefsson <jas@extundo.com>
Wed, 19 Mar 2003 23:12:56 +0000 (23:12 +0000)
committerSimon Josefsson <jas@extundo.com>
Wed, 19 Mar 2003 23:12:56 +0000 (23:12 +0000)
(message-idna-to-ascii-rhs): Use it.
gnus-art.el (gnus-use-idna): Disable if UTF-8 unavailable.

lisp/ChangeLog
lisp/gnus-art.el
lisp/message.el

index c026e41..2862e05 100644 (file)
@@ -1,3 +1,10 @@
+2003-03-20  Simon Josefsson  <jas@extundo.com>
+
+       * message.el (message-use-idna): Disable if UTF-8 unavailable.
+       (message-idna-to-ascii-rhs): Use it.
+
+       * gnus-art.el (gnus-use-idna): Disable if UTF-8 unavailable.
+
 2003-03-19  Teodor Zlatanov  <tzz@lifelogs.com>
 
        * spam.el (spam-group-ham-mark-p, spam-group-spam-mark-p) 
index 51009cb..c78a405 100644 (file)
@@ -1320,7 +1320,9 @@ It is a string, such as \"PGP\". If nil, ask user."
 (defvar gnus-article-wash-function nil
   "Function used for converting HTML into text.")
 
-(defcustom gnus-use-idna (condition-case nil (require 'idna) (file-error))
+(defcustom gnus-use-idna (and (condition-case nil (require 'idna) (file-error))
+                             (fboundp 'coding-system-p)
+                             (coding-system-p 'utf-8))
   "Whether IDNA decoding of headers is used when viewing messages.
 This requires GNU Libidn, and by default only enabled if it is found."
   :group 'gnus-article-headers
index 7cf7afa..d475da4 100644 (file)
@@ -1288,7 +1288,11 @@ no, only reply back to the author."
   :link '(custom-manual "(message)News Headers")
   :type 'string)
 
-(defcustom message-use-idna 'ask
+(defcustom message-use-idna (and (condition-case nil (require 'idna)
+                                  (file-error))
+                                (fboundp 'coding-system-p)
+                                (coding-system-p 'utf-8)
+                                'ask)
   "Whether to encode non-ASCII in domain names into ASCII according to IDNA."
   :group 'message-headers
   :type '(choice (const :tag "Ask" ask)
@@ -4685,7 +4689,7 @@ I.e., calling it on a Subject: header is useless."
   "Possibly IDNA encode non-ASCII domain names in From:, To: and Cc: headers.
 See `message-idna-encode'."
   (interactive)
-  (when (condition-case nil (require 'idna) (file-error))
+  (when message-use-idna
     (save-excursion
       (save-restriction
        (message-narrow-to-head)