Ticket #1317 (new enhancement)

Opened 6 years ago

Last modified 10 months ago

wish $edit_charset

Reported by: Tony Leneis <tony@cvr.ds.adp.com> Assigned to: mutt-dev
Priority: minor Milestone:
Component: mutt Version: 1.4i
Keywords: Cc: dominique@unruh.de, kurt@roeckx.be

Description

Package: mutt
Version: 1.4i
Severity: wishlist

-- Please type your report below this line

It would be nice if the charset muttrc configuration variable could be
split into charset and edit_charset.  charset would apply to the display
and built-in editor, and edit_charset would apply when an external editor
is used.

My terminal program supports ISO-8859-1 characters, so I have charset set
to ISO-8859-1//TRANSLIT (I need //TRANSLIT on the end so I can see things
like left and right double quotes.)  My editor, vim, supports UTF-8.  The
way things currently stand, I can reasonably read messages, but certain
information is lost (e.g. double left quotes and double right quotes both
become ASCII double quotes.)  If I could configure mutt to convert the
message to UTF-8 before calling vim, I could reply with minimal loss of
information (depending on how send_charset is set, but that's exactly what
we'd want.)

-Tony

-- Build environment information

(Note: This is the build environment installed on the system
muttbug is run on.  Information may or may not match the environment
used to build mutt.)

- gcc version information
cc


cc: Error: no source, object or ucode file specified

- CFLAGS
-std1 -fast -O4 -tune host -arch host -D_XOPEN_SOURCE_EXTENDED

-- Mutt Version Information

Mutt 1.4i (2002-05-29)
Copyright (C) 1996-2001 Michael R. Elkins and others.
Mutt comes with ABSOLUTELY NO WARRANTY; for details type `mutt -vv'.
Mutt is free software, and you are welcome to redistribute it
under certain conditions; type `mutt -vv' for details.

System: OSF1 V4.0 (alpha)
Compile options:
-DOMAIN
-DEBUG
-HOMESPOOL  -USE_SETGID  +USE_DOTLOCK  -DL_STANDALONE  
+USE_FCNTL  -USE_FLOCK
+USE_POP  +USE_IMAP  -USE_GSS  +USE_SSL  -USE_SASL  
+HAVE_REGCOMP  -USE_GNU_REGEX  
+HAVE_COLOR  +HAVE_START_COLOR  +HAVE_TYPEAHEAD  +HAVE_BKGDSET  
+HAVE_CURS_SET  +HAVE_META  -HAVE_RESIZETERM  
+HAVE_PGP  -BUFFY_SIZE -EXACT_ADDRESS  -SUN_ATTACHMENT  
+ENABLE_NLS  -LOCALES_HACK  +HAVE_WC_FUNCS  +HAVE_LANGINFO_CODESET  +HAVE_LANGINFO_YESEXPR  
+HAVE_ICONV  -ICONV_NONTRANS  +HAVE_GETSID  -HAVE_GETADDRINFO  
ISPELL="/usr/local/bin/ispell"
SENDMAIL="/usr/sbin/sendmail"
MAILPATH="/var/spool/mail"
PKGDATADIR="/usr/local/share/mutt"
SYSCONFDIR="/usr/local/etc"
EXECSHELL="/bin/sh"
MIXMASTER="mixmaster"
To contact the developers, please mail to <mutt-dev@mutt.org>.
To report a bug, please use the flea(1) utility.


Received: (at submit) by bugs.guug.de; 18 Jan 2001 15:32:24 +0000
From nil@wh36-b507.stud.uni-karlsruhe.de  Thu Jan 18 16:32:23 2001
Received: from mailgate.rz.uni-karlsruhe.de (exim@mailgate.rz.uni-karlsruhe.de [129.13.64.97])
	by sigtrap.guug.de (8.9.3/8.9.3/Debian/GNU) with ESMTP id QAA28955
	for <submit@bugs.guug.de>; Thu, 18 Jan 2001 16:32:23 +0100
Received: from wh36-b507.stud.uni-karlsruhe.de (root@wh36-b507.stud.uni-karlsruhe.de [172.20.230.117])
	by mailgate.rz.uni-karlsruhe.de with esmtp (Exim 3.16 #1)
	id 14JH30-0007Kk-00; Thu, 18 Jan 2001 16:32:22 +0100
Received: (from nil@localhost)
	by wh36-b507.stud.uni-karlsruhe.de (8.11.1/8.11.1/Debian 8.11.0-6) id f0IFWMF03963;
	Thu, 18 Jan 2001 16:32:22 +0100
Date: Thu, 18 Jan 2001 16:32:22 +0100
Message-Id: <200101181532.f0IFWMF03963@wh36-b507.stud.uni-karlsruhe.de>
From: dominique@unruh.de
Subject: mutt-1.3.13i: There should be a variable editor_charset
To: submit@bugs.guug.de

Package: mutt
Version: 1.3.12-2
Severity: wishlist

-- Please type your report below this line

This is a feature request.

There should be a variable editor_charset, which determines the
charset in which an external editor reads and writes files. At the
moment it is always the same as the terminal encoding ($charset). 

This feature is e.g. motivated by the following situation:

Many users may have an unicode-editor (as yudit or emacs+mule-ucs),
but do not want to configure their mutt terminal for UTF-8 support
(because this is a little tricky and requires recompilation of mutt in
most cases).

DniQ.


-- Mutt Version Information

Mutt 1.3.13i (2000-12-31)
Copyright (C) 1996-2000 Michael R. Elkins and others.
Mutt comes with ABSOLUTELY NO WARRANTY; for details type `mutt -vv'.
Mutt is free software, and you are welcome to redistribute it
under certain conditions; type `mutt -vv' for details.

System: Linux 2.2.17 [using ncurses 5.0]
Compile options:
-DOMAIN
+DEBUG
-HOMESPOOL  +USE_SETGID  +USE_DOTLOCK  +DL_STANDALONE  
+USE_FCNTL  -USE_FLOCK
-USE_POP  -USE_IMAP  -USE_GSS  -USE_SSL  -USE_SASL  
+HAVE_REGCOMP  -USE_GNU_REGEX  
+HAVE_COLOR  +HAVE_START_COLOR  +HAVE_TYPEAHEAD  +HAVE_BKGDSET  
+HAVE_CURS_SET  +HAVE_META  +HAVE_RESIZETERM  
+HAVE_PGP  -BUFFY_SIZE -EXACT_ADDRESS  -SUN_ATTACHMENT  
+ENABLE_NLS  -LOCALES_HACK  -HAVE_WC_FUNCS  +HAVE_LANGINFO_CODESET  +HAVE_LANGINFO_YESEXPR  
+HAVE_ICONV  -ICONV_NONTRANS  +HAVE_GETSID  -HAVE_GETADDRINFO  
ISPELL="/usr/bin/ispell"
SENDMAIL="/usr/sbin/sendmail"
MAILPATH="/var/mail"
SHAREDIR="/usr/share/mutt"
SYSCONFDIR="/etc"
EXECSHELL="/bin/sh"
-MIXMASTER
To contact the developers, please mail to <mutt-dev@mutt.org>.
To report a bug, please use the flea(1) utility.


>How-To-Repeat:
>Fix:

Change History

2001-01-19 00:30:23 changed by Lars Hecking <lhecking@nmrc.ie>

> This is a feature request.
> 
> There should be a variable editor_charset, which determines the
> charset in which an external editor reads and writes files. At the
> moment it is always the same as the terminal encoding ($charset). 
> 
> This feature is e.g. motivated by the following situation:
> 
> Many users may have an unicode-editor (as yudit or emacs+mule-ucs),
> but do not want to configure their mutt terminal for UTF-8 support
> (because this is a little tricky and requires recompilation of mutt in
> most cases).

$ grep editor ~/.muttrc
set editor="LC_CTYPE=en_IE.ISO8859-15 vi"
$

2001-01-19 01:05:55 changed by Edmund GRIMLEY EVANS <edmundo@rano.org>

Lars Hecking <lhecking@nmrc.ie>:

> > This is a feature request.
> > 
> > There should be a variable editor_charset, which determines the
> > charset in which an external editor reads and writes files. At the
> > moment it is always the same as the terminal encoding ($charset). 
> > 
> > This feature is e.g. motivated by the following situation:
> > 
> > Many users may have an unicode-editor (as yudit or emacs+mule-ucs),
> > but do not want to configure their mutt terminal for UTF-8 support
> > (because this is a little tricky and requires recompilation of mutt in
> > most cases).
> 
> $ grep editor ~/.muttrc
> set editor="LC_CTYPE=en_IE.ISO8859-15 vi"
> $

We're assuming the editor cannot be made to use the same encoding as
Mutt's $charset, so you need to set editor=some_script like:

#!/bin/sh
iconv -f iso-8859-1 -t utf-8 < $1 > $1.utf
yudit $1.utf
iconv -f utf-8 -t iso-8859-1 < $1.utf > $1

So it can be solved using $editor, and it's probably not worth adding
yet another variable to Mutt.

Edmund

2001-01-19 02:52:35 changed by Dominique Unruh <dominique@unruh.de>

> > Many users may have an Unicode-editor (as yudit or emacs+mule-ucs),
> > but do not want to configure their mutt terminal for UTF-8 support
> > (because this is a little tricky and requires recompilation of mutt in
> > most cases).

> set editor="LC_CTYPE=en_IE.ISO8859-15 vi"

This is not exactly a solution to my problem. A user may e.g. wish to
enter Japanese characters, which he can't enable in an standard
terminal. But if the editor has another charset (e.g. UTF8 or JIS), he
can type the mail in Japanese and look at it using 'view-mailcap',
provided an properly configured .mailcap.

This is especially useful for people who have occasionally
correspondence in foreign scripts, but whose biggest part of mails is
latin1 encoded.

DniQ.

2001-01-19 03:21:29 changed by Dominique Unruh <dominique@unruh.de>

> #!/bin/sh
> iconv -f iso-8859-1 -t utf-8 < $1 > $1.utf
> yudit $1.utf
> iconv -f utf-8 -t iso-8859-1 < $1.utf > $1

This is still not what I had in mind. I thought of an user, who
*wants* to use the capabilities of unicode or another big encoding,
and accepts that some characters may be not be displayable in mutt,
because he can read the mail in an external viewer in cases of need.

Suppose you want to compose emails which contain both french and
hungarian (think of an e-mail language course). You can't achieve this
with a normal 8-bit encoding, so you will have to type it with an
unicode editor, but you still can read the mail in mutt, because the
biggest part of the mail is ASCII, thus the text is still intelligible
with the latin1/latin2 characters replaced by a box. And if you want
to see it with right diacritics, you may look at it using
'view-mailcap'.

I do further think, that the separation of terminal charset and editor
charset is quite a natural one in our days of GUIs, because the editor
often does not run in the same terminal as mutt any more.

DniQ.

2003-09-14 09:55:35 changed by Alain Bench <veronatif@free.fr>

merge 433 1317
merge 676 965

2005-08-24 06:11:20 changed by rado

Some control of the interaction between mutt and external editor is certainly needed, 
see http://wiki.mutt.org/?MuttFaq/Charset

2006-08-27 06:34:52 changed by ab

Deduppe unform. Add to notifieds:
 - Dominique Unruh, reporter of Flea #433 "There should be a
variable editor_charset".
 - Kurt Roeckx, reporter of Debian #384642 "Editing mails in
UTF-8 on a latin1 terminal".

Alain.

2007-09-20 04:28:20 changed by vinc17

This should probably be regarded as a bug as when replying, the quoted message may be modified when converted to the local charset. I think it is important to keep it unmodified though the user who replies cannot necessarily read it completely (in particular when the reply is a follow-up to a mailing-list).