Tuesday, February 9, 2016

Re: How to get vim to display Cyrillic, Greek, or Russian? [Was: Feature or bug? dw oddities]

2016-02-09 14:48 GMT+03:00 Erik Christiansen <dvalin@internode.on.net>:
> On 09.02.16 09:49, Tony Mechelynck wrote:
>> On Tue, Feb 9, 2016 at 8:24 AM, Erik Christiansen
>> > Does anyone know what it takes to get vim to display Cyrillic, Greek, or
>> > Russian characters in a (utf-8 enabled) xterm? (Note: Vim encoding while
>> > editing this post, in which the Russian won't display, is
>> > "encoding=utf-8")
>> >
>> > There's no problem with Danish: åæø
>> > or German: ßöä
> ...
>>
>> I think the reason it works for me is related with my bash startup
>> scripts, one of which (I'm not sure which: see "man bash" for details)
>> sets the following environment variables:
>>
>> export LANG=en_US.UTF-8
>> export LC_TIME=en_GB
>> export LC_PAPER=en_GB
>> export LC_NUMERIC=C
>
> Both in the case of complete failure, and the case with mutt working but
> vim not, I've had the default:
>
> $ echo $LANG
> en_AU.utf8
>
> so that's not the impediment. (Trying "en_AU.UTF-8" instead makes no
> difference) And trying "export LANG=en_US.UTF-8" before invoking mutt or
> vim causes mutt to corrupt the Russian and the thread tree lines, and
> vim to not even display the Danish, i.e. much worse.
>
> ...
>> In addition, for Vim you may need to make sure that it uses UTF-8
>> internally, see http://vim.wikia.com/wiki/Working_with_Unicode
>
> Ah, that looks promising. Checking the settings used in the script
> snippet presented there:
>
> encoding=utf-8
> termencoding=
>
> Ahah! But adding a "let &termencoding = &encoding" to .vimrc did not
> help vim to display the Russian charactors. They remain as "=xx" stuff.
>
> fileencoding=utf-8
> fileencodings=ucs-bom,utf-8,default,latin1
>
> These also were already in line with the howto hints.
>
> Thank you for the hints, Tony, but nothing tried so far is making any
> difference. Vim still won't display Cyrillic, Greek, or Russian.
>
> But is this a clue? My immediate prior post, containing åæø, came back
> from the list server with those three characters now displaying in vim
> as -C3-A5-C3-A6-C3-B8, despite the header: "X-NotAscii: charset=utf-8".
> (Again, s/-/==/g) In vim, encoding, fileencoding, and termencoding are
> all utf-8.
>
>
> Is our list server not sending utf-8, despite the header claim?

It is sending a proper UTF-8. You must use a client which correctly
decodes the message: you should see those equals signs if
Content-Transfer-Encoding is [quoted-printable][1], but message body
was not decoded. If there is no header Content-Transfer-Encoding with
the said value then you caught a bug somewhere, most likely somewhere
between google groups and your PC because I do not see any messages in
this thread which have X-NotAscii header. AFAIK GG does not bother
itself changing messages content or content* headers.

I do see some messages with `Content-Transfer-Encoding:
quoted-printable` in this thread, but in gmail they are displayed
correctly.

See also https://en.wikipedia.org/wiki/Unicode_and_email.

[1]: https://en.wikipedia.org/wiki/Quoted-printable

>
> Erik
>
> --
> --
> You received this message from the "vim_use" maillist.
> Do not top-post! Type your reply below the text you are replying to.
> For more information, visit http://www.vim.org/maillist.php
>
> ---
> You received this message because you are subscribed to the Google Groups "vim_use" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

--
--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

No comments:

Post a Comment