Gnus development mailing list
 help / color / mirror / Atom feed
From: Reiner Steib <reinersteib+gmane@imap.cc>
Subject: Display unknown non-ASCII chars as `.', `X' or `?' (was: Setup additional charsets on demand)
Date: Wed, 12 Oct 2005 00:19:39 +0200	[thread overview]
Message-ID: <v9br1vd7d0.fsf@marauder.physik.uni-ulm.de> (raw)
In-Reply-To: <v9y84zd8mz.fsf@marauder.physik.uni-ulm.de>

On Tue, Oct 11 2005, Reiner Steib wrote:

> in reaction to Matthias Andree's posting[1]...
>
> ,----[ http://thread.gmane.org/gmane.emacs.gnus.general/59971 ]
> | What's up here? Does Gnus lack Windows-1251? If so, why does it not
> | replace everything by dots, X or ?. If it supports Windows-1251, why
> | doesn't it see it? [...] (Emacs 21.3 with rm'd movemail)
> `----
>
> ... I added `mm-charset-eval-alist' to the trunk now.

While at it...
| If so, why does it not replace everything by dots, X or ?.

I.e. if the charset is not available: How can we configure Gnus to
display every non-ASCII chars as `.', `X' or `?'?

One solution is to define a "dummy coding system" where all non-ASCII
chars are replaced by some place holder:

(defun rs-ucs-ascii-8bit-dumb (&optional char)
  "Create dummy coding system `rs-ucs-ascii-8bit-dumb'."
  (unless char (setq char ?\?))
  ;; We need cp-make-coding-system (Emacs 22)
  (unless (fboundp 'cp-make-coding-system)
    (error "Function requires `cp-make-coding-system'"))
  (cp-make-coding-system
   rs-ucs-ascii-8bit-dumb
   (make-vector 128 char)
   (format "Dummy coding system.  Replace all non-ASCII chars as `%c'." char)
   ?\?))
(rs-ucs-ascii-8bit-dumb ?¿)
(add-to-list 'mm-charset-override-alist
	     '(undecided . rs-ucs-ascii-8bit-dumb))

With this, also non-ASCII chars in postings without proper MIME
headers[1] will be displayed as `¿'.  (IIRC, slrn and tin replace
unknown characters with `?'.  Some people like this and turn off
fallbacks like iso-8859-1.)

Can we achieve the same without using functions from Emacs 22
(`cp-make-coding-system')?

Bye, Reiner.

[1] Some examples: <news:Usenet.qaremkmn@localhost>,
    <news:Usenet.cfkoelmf@localhost>
-- 
       ,,,
      (o o)
---ooO-(_)-Ooo---  |  PGP key available  |  http://rsteib.home.pages.de/




  reply	other threads:[~2005-10-11 22:19 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-10-11 21:52 Setup additional charsets on demand Reiner Steib
2005-10-11 22:19 ` Reiner Steib [this message]
2005-10-12  7:58   ` Display unknown non-ASCII chars as `.', `X' or `?' Bjørn Mork
2005-10-13 20:39     ` Reiner Steib
2005-10-14  6:38       ` Bjørn Mork

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=v9br1vd7d0.fsf@marauder.physik.uni-ulm.de \
    --to=reinersteib+gmane@imap.cc \
    --cc=Reiner.Steib@gmx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).