2

I use GNU Emacs 24.2.1 (but on never Emacs it does not working too) with Gnus v5.13 and have configured it as follows to use Lynx to format the HTML mails:

(setq 'mm-text-html-renderer 'lynx)
(setcdr (assoc 'lynx mm-text-html-renderer-alist)
        '(mm-inline-render-with-stdin
          nil "lynx" "-dump" "-force_html" "-stdin" "-display_charset=UTF-8"))

But UTF-8 characters are not displayed correctly, for example i see something like that:

Es gibt \303\274ber 700 neue Top-Level-Domains.

It can easy be solved with this commands:

(toggle-read-only)
(recode-region (point-min) (point-max) 'utf-8 'utf-8)

But is it possible to get Gnus to interpret the Lynx output generally as UTF-8?

(This question was also asked without answers here: http://lists.gnu.org/archive/html/info-gnus-english/2010-06/msg00006.html)

OK2
  • 46
  • 7

1 Answers1

0

I have found an answer by my self, here full code to activate Lynx in Gnus with UTF-8:

(require 'mm-view)
(setq mm-text-html-renderer 'lynx)
(setcdr (assoc 'lynx mm-text-html-renderer-alist)
        '(mm-inline-render-with-stdin
          nil "lynx" "-dump" "-force_html" "-stdin" "-display_charset=UTF-8"))

(defvar mm-insert-inline-use-utf-8 nil)

(defadvice mm-insert-inline (around mm-insert-inline-utf-8)
  (let ((x (point)))
    (prog1 (progn ad-do-it)
      (when mm-insert-inline-use-utf-8
        (decode-coding-region x (point-max) 'utf-8)))))
(ad-activate 'mm-insert-inline)

(defadvice mm-inline-text-html (around mm-inline-text-html-utf-8)
  (let ((mm-insert-inline-use-utf-8 t))
    ad-do-it))
(ad-activate 'mm-inline-text-html)
OK2
  • 46
  • 7
  • Maybe you could somehow set the coding system for the `lynx` invocation? Or even for all subprocesses? – tripleee Nov 19 '13 at 19:49
  • Lynx is set to UTF-8 (`display_charset` argument and right locale variables are also set), but Gnus read it in function `mm-inline-render-with-stdin` with macro `mm-with-unibyte-buffer` and therefore ignores the charset of the program. – OK2 Nov 19 '13 at 20:24