<<< Date Index >>>     <<< Thread Index >>>

Re: Charset of an edited message with $editor



On 2004-12-23 14:28:59 +0100, Alain Bench wrote:
> Salut Vincent!

Salut Alain, et joyeux Noël!

>  On Thursday, December 23, 2004 at 12:57:14 AM +0100, Vincent Lefèvre wrote:
> 
> > the charset used in an edited message with $editor [...] When
> > composing a new message or a reply, it seems to be the charset defined
> > by the locales
> 
>     Yes: $charset, defaulting to the locale's charset.

Well, $charset is:

  Character set your terminal uses to display and enter textual data.

So, in practice, this is the locale's charset.

Of course, it could have been different, as editors are able to
deal with encodings that are different from the current locales
(e.g. it could be interesting to use UTF-8 as the encoding for
file contents, though the editor could be started in various
locales, the advantage being that the quoted characters in a
reply would never be replaced by something else).

>     <edit> ("edit the raw message") does pure raw editing: Charset is
> irrelevant (think <edit>ing a multipart with part Latin-1 and part
> KOI8-R). But editor's autosensing feature can here help, in simple
> cases: Autosensing, and saving in sensed charset.

OK. I just hope that the editor wouldn't corrupt the text if
mixed encodings are used (in the past, I reported a bug about
that in Emacs, which has then been fixed).

I now recognize this case with

  [ "`head -c5 \"$1\"`" = "From " ]

-- 
Vincent Lefèvre <vincent@xxxxxxxxxx> - Web: <http://www.vinc17.org/>
100% accessible validated (X)HTML - Blog: <http://www.vinc17.org/blog/>
Work: CR INRIA - computer arithmetic / SPACES project at LORIA