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

Re: utf8 encoding problem, but which part?



-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On Tuesday, October 16 at 09:11 AM, quoth Raphael Brunner:
> my problem isn't clear for me,  what it is exactly.

Nor is it for anyone you're describing it to.

> I became a mail from russia with koi8-u encoding (in mailheader).

You mean you *received* such an email?

> My system is debian stable. In muttrc, I defined 'set 
> charset=utf-8',

It's typically (unless you know what you're doing) better to let mutt 
detect the charset, so take that out of your muttrc.

> the terminal is mlterm (I tried also xterm with the same result)

I don't know anything about mlterm, but xterm can't display the full 
utf-8 character set unless you do to things: first, you must have it 
using a font that has all the right characters in it, and second, you 
must run xterm with the correct options (e.g. use the wrapper script 
`uxterm`).

> and locale output (see below) shows good. Now, the mailcontent in 
> mutt is right,

Good.

> but if I reply to this (mails open with vim), then there are strange 
> signs there (but only the not-ascii). Regardless if I set ':set 
> encoding=utf-8' in vim or not, vim don't show this characters 
> correct.

Firstly, setting the encoding in vim to be utf-8 only changes vim's 
internal representation of characters, it does NOT change vim's 
understanding of the file it's editing. Here's a clip from vim's 
documentation:

     NOTE: Changing this option will not change the encoding of the
        existing text in Vim.  It may cause non-ASCII text to become invalid.
        It should normally be kept at its default value, or set when Vim
     starts up.  See |multibyte|.

More helpfully:

     The character encoding of files can be different from 'encoding'.
        This is specified with 'fileencoding'.  The conversion is done with
        iconv() or as specified with 'charconvert'.

        Normally 'encoding' will be equal to your current locale.  This will
        be the default if Vim recognizes your environment settings.  If
        'encoding' is not set to the current locale, 'termencoding' must be
        set to convert typed and displayed text.  See |encoding-table|.

So you want to leave 'encoding' alone, and change 'fileencoding'.

What you need to do is figure out what character set mutt is saving 
its temporary files as. I believe (but I haven't checked) that mutt 
doesn't do any conversion, and saves the temporary files in the same 
character set as the email.

> I tried also emacs, it display exact the same like vim.

Probably because it assumed (just like vim) that the text was encoded 
in either us-ascii or utf-8.

Hope that helps,
~Kyle
- -- 
When ideas fail, words come in very handy.
                                          -- Johann Wolfgang von Goethe
-----BEGIN PGP SIGNATURE-----
Comment: Thank you for using encryption!

iD8DBQFHJd6ABkIOoMqOI14RAp0wAKDdBnu6oDPuR4t2KoJOo7c1Jq8Q7gCgzwNc
JbXhVAaXhnOI+mZmbRiQxss=
=dfo6
-----END PGP SIGNATURE-----