Tuesday, February 9, 2016

Re: Feature or bug? dw oddities

On Tue, Feb 9, 2016 at 8:24 AM, Erik Christiansen
<dvalin@internode.on.net> wrote:
> On 08.02.16 10:50, Matt Ackeret wrote:
>> The next text will be from the Russian input method:
>> АВСРОМИС
>>
>> This wasn't typed in Terminal, but I just typed Russian characters
>> into Terminal, and they showed up fine.
>
> Viewing Cyrillic, Greek, or Russian characters doesn't work for me in
> "xterm" on Debian 7.8.0, either in mutt or vim. Mutt just renders them
> invisible, and vim displays the above line as:
>
> -D0-90-D0-92-D0-A1-D0-A0-D0-9E-D0-9C-D0-98-D0-A1
>
> ( I did s/-/=/g , so as not to render as sent in your environment.)
>
> If I use "xterm -lc", then mutt displays the above characters as
> Russian, confirming a utf-8 locale AFAICT, but vim still gives the "=xx"
> stuff, both within mutt, and invoked directly in the "xterm -lc". Hmmm,
> is this relevant?:
>
> $ echo $LOCALE
>
> I.e. it's not set.
>
> Alas, trying "xterm -en UTF-8" doesn't make any difference. Mutt still
> works, and vim fails.
>
> 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: ßöä
>
> Erik
>

My xterm displays the Cyrillic characters above as Cyrillic, even in
Vim, so it is definitely possible. My only xterm startup argument is a
-geometry parameter (xterm -geometry 160x60) to give it a "reasonable"
size on my 1280x1024 screen.

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

If you use (t)csh instead the syntax would of course be different.
$LANG is the fallback for any undefined locale variable, and $LC_ALL
(intentionally unset) would override them all. Since $LC_CTYPE (the
character set) is not set, it defaults to the value of $LANG, which
sets UTF-8. Then if once these settings are set you still don't see
non-ASCII characters, you might have to find out how to start xterm
with a different font. (The two "British" settings are so I get A4
paper and dd/mm/yyyy dates.)

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


Best regards,
Tony.

--
--
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: