Re: [OT] ncursesw and UTF-8
On Mon, Nov 03, 2003 at 11:49:00PM -0500, David Yitzchak Cohen wrote:
> On Mon, Nov 03, 2003 at 10:00:00AM +0100, Andrei A. Voropaev wrote:
[...]
> > Actually it works fine. It just also has to be linked to support wide
> > chars. Just mutt has to be linked against ncursesw.
>
> Okay, then let me correct myself: bash most certainly does NOT work well
> with UTF without rebuilding from source ... which means my frustration
> still need venting. . .
Well. I hear you :) I didn't recompile bash myself :)
>
> My locale is setup as LC_ALL, LANG, and LC_CTYPE all set to es_ES.UTF-8
> everywhere, running on a UTFed console ... and it works fine for many
> programs - including my own (which use gettext). In fact, the messages
> are internationalized even in bash itself (albeit 8859-1, not UTF -
> perhaps the note you made below applies here). However, when I type an
> á for instance, it appears as \303\241 instead (although the resulting
> message when I try to execute it comes out correctly as "bash: á:
> command not found"). Bash seems unique in this regard, as every other
> program I can think of off-hand that I use has no trouble outputting
> the actual characters I type.
I'm afraid that this is purely related to console configuration. Bash
outputs UTF-8 sequence but console does not interpret it as such. Try to
read the section on Linux console in the document I reference below. It
mentions unicode_start and unicode_stop programs for making console
understand UTF-8.
>
> > In my case I make sure that
> > there's absolutely no LC_ and no LANG variables in my enviroment.
>
> Neither of those hurts to have if you never switch locales.
Yes. As long as you set them up to desired values. My desire is to have
everything in english, and only show text in different languages.
>
> > Then I
> > start xterm with the following command line
> >
> > LC_CTYPE=en_GB.UTF-8 xterm -fn
> > '-misc-fixed-medium-r-semicondensed-*-13-*-*-*-*-*-iso10646-1'
>
> Consoles don't need any of that fancy gunk ;-P
Consoles also don't work as good as X windows application :(
> > And of course it's worth mentioning that en_GB.UTF-8 locale was not
> > available originally in my distribution so I had to create it using
> > localedef program. Note that since this locale is UTF-8 you don't really
> > care if it is en_GB or de_DE or whatever.
>
> Do you happen to have the commandline available off-hand? If not,
> I'll just look it up; but if yes, you can save me some time.
This comes from
http://www.ibiblio.org/pub/Linux/docs/HOWTO/other-formats/html_single/Unicode-HOWTO.html
localedef -v -c -i de_DE -f UTF-8 de_DE.UTF-8
In place of 'de_DE' anything else can be put. I've used 'en_GB'. But if
you already have es_ES.UTF-8 then most likely you don't need this
program. Just look into the section for Linux Console.
Andrei