comparison lisp/gnus/nnimap.el @ 100039:d13d583ff5cc

(nnimap-demule-use-string-to-multibyte): New temporary variable for debugging bug#464 and bug#1174. (nnimap-demule): Use it.
author Reiner Steib <Reiner.Steib@gmx.de>
date Sat, 29 Nov 2008 15:26:49 +0000
parents a30459da1bd7
children d0077257129f
comparison
equal deleted inserted replaced
100038:a368e04ccb9a 100039:d13d583ff5cc
899 (deffoo nnimap-status-message (&optional server) 899 (deffoo nnimap-status-message (&optional server)
900 "This function returns the last error message from server." 900 "This function returns the last error message from server."
901 (when (nnimap-possibly-change-server server) 901 (when (nnimap-possibly-change-server server)
902 (nnoo-status-message 'nnimap server))) 902 (nnoo-status-message 'nnimap server)))
903 903
904 (defvar nnimap-demule-use-string-to-multibyte (fboundp 'string-to-multibyte)
905 "Temporary internal debug variable.
906 If you have problems (UTF-8 not decoded correctly on IMAP) with
907 the default value, please report it as a bug!")
908 ;; FIXME: Clarify if we need to make this variable conditional on the Emacs
909 ;; version (Emacs 22 vs. Emacs 23;Emacs 21 doesn't have `string-to-multibyte'
910 ;; anyhow). --rsteib
911 ;;
912 ;; http://thread.gmane.org/gmane.emacs.gnus.general/67112
913 ;; (bug#464, reported by James Cloos)
914 ;; http://thread.gmane.org/gmane.emacs.bugs/21524
915 ;; (bug#1174, reported by Frank Schmitt)
916
904 (defun nnimap-demule (string) 917 (defun nnimap-demule (string)
905 ;; BEWARE: we used to use string-as-multibyte here which is braindead 918 ;; BEWARE: we used to use string-as-multibyte here which is braindead
906 ;; because it will turn accidental emacs-mule-valid byte sequences 919 ;; because it will turn accidental emacs-mule-valid byte sequences
907 ;; into multibyte chars. --Stef 920 ;; into multibyte chars. --Stef
908 ;; Reverted, braindead got 7.5 out of 10 on imdb, so it can't be 921 ;; Reverted, braindead got 7.5 out of 10 on imdb, so it can't be
909 ;; that bad. --Simon 922 ;; that bad. --Simon
923 (gnus-message 9 "nnimap-demule-use-string-to-multibyte: %s"
924 nnimap-demule-use-string-to-multibyte)
925 (if nnimap-demule-use-string-to-multibyte
926 ;; Stefan
927 (funcall (if (and (fboundp 'string-to-multibyte)
928 (subrp (symbol-function 'string-to-multibyte)))
929 'string-to-multibyte
930 'identity)
931 (or string "")))
932 ;; Simon
910 (funcall (if (and (fboundp 'string-as-multibyte) 933 (funcall (if (and (fboundp 'string-as-multibyte)
911 (subrp (symbol-function 'string-as-multibyte))) 934 (subrp (symbol-function 'string-as-multibyte)))
912 'string-as-multibyte 935 'string-as-multibyte
913 'identity) 936 'identity)
914 (or string ""))) 937 (or string "")))