Ar an seachtú lá de mí na Nollaig, scríobh Uwe Brauer:
One solution consists of using the following (tcsh shell)
setenv LANG de_DE.UTF-8
/usr/local/bin/xemacs &
I still don't see why this is necessary in Xemacs but not in
GNU emacs?
This is probably at the root of it. I’m not sure what
url-retrieve-synchronously promises about the encoding of the buffer under
XEmacs, I suspect it doesn’t promise anything at all, and if things happen
to work, it’s because the language environment and the remote web page
encoding happen to agree.
;; xemacs compatibility
(eval-and-compile
(if (featurep 'xemacs)
;; XEmacs
(defun babel-url-retrieve (url)
"Retrieve URL and decode"
(let ((current (current-buffer))
(tmp (url-retrieve-synchronously url)))
(with-current-buffer tmp
;;shrug: we asume utf8
(decode-coding-region (point-min) (point-max) 'utf-8)
(copy-to-buffer current (point-min) (point-max)))
(kill-buffer tmp)))
;; GNUs Emacs
(require 'url-handlers)
(defun babel-url-retrieve (url) ;; return a buffer
(let* ((url-show-status nil)
(tmp (url-retrieve-synchronously url)))
(unless (cadr (url-insert tmp))
(mm-decode-coding-region (point-min) (point-max) 'utf-8))
(kill-buffer tmp)))))
--
‘Iodine deficiency was endemic in parts of the UK until, through what has been
described as “an unplanned and accidental public health triumph”, iodine was
added to cattle feed to improve milk production in the 1930s.’
(EN Pearce, Lancet, June 2011)
_______________________________________________
XEmacs-Beta mailing list
XEmacs-Beta(a)xemacs.org
http://lists.xemacs.org/mailman/listinfo/xemacs-beta