utf8 and urxvt

I have done some testing, running latest Wary. The problem that has been described is that Urxvt cannot display unicode characters when utf8 is enable for the locale. Also, zigbert reported a problem with Viewnior.

I selected 'nb_NO.utf8', which is what zigbert uses, then restarted X. I then clicked the 'console' icon on the desktop to start urxvt and did some basic tests. Unicode characters displayed ok in the terminal, and Viewnior worked fine:



So, what is the problem? Is there something else that I need to do to expose a problem?

Note, nb_NO.utf8 and nb_NO.UTF-8 should be equivalent for Xlib applications, as X refers to /usr/X11R7/lib/X11/locale/locale.alias, which specifies them as aliases.

Well, no, that is interesting. The particular case of "nb_NO.utf8 nb_NO.UTF-8" alias is not in /usr/X11R7/lib/X11/locale/locale.alias. But I still have no problem as per the above snapshot.


Posted on 13 Feb 2011, 8:23


Comments:

Posted on 13 Feb 2011, 11:36 by shinobar
utf8 or UTF-8
[quote="Barry"]Note, nb_NO.utf8 and nb_NO.UTF-8 should be equivalent for Xlib applications, as X refers to /usr/X11R7/lib/X11/locale/locale.alias, which specifies them as aliases.

Well, no, that is interesting. The particular case of "nb_NO.utf8 nb_NO.UTF-8" alias is not in /usr/X11R7/lib/X11/locale/locale.alias. But I still have no problem as per the above snapshot. [/quote]
Good point. But your test seems strange.

Yes, '.utf8' is allowed if the locale.alias has the entry, but there are no entry as for 'nb_NO.utf8'.
My test on Wary-503 after creating 'nb_NO.utf8' by countrywizard:
# LANG=nb_NO.utf8 urxvt
rxvt: the locale is not supported by Xlib, working without locale support.

Whereas 'LANG=nb_NO.UTF-8' succeeds.


Posted on 13 Feb 2011, 19:19 by rodin.s
printing in russian in urxvt
If I want to print in russian in urxvt from keyboard I cannot do this with LANG=ru_UA.utf8, but it works with LANG=ru_UA.UTF-8


Posted on 13 Feb 2011, 20:08 by BarryK
utf8 alias fixed
The missing alias for nb_NO.utf8 in /usr/share/X11/locale/locale.alias, is an error. I did a search, it has been reported as an error and may be fixed in more recent X.org.

Anyway, it is easy to fix. I tested by appending 'nb_NO.utf8: nb_NO.UTF-8' onto locale.alias, and it works, no error message when start urxvt with LANG=nb_NO.utf8.

There are at least two others that need fixing, and I have put the fix into 3builddistro in Woof:

#110213 fix if .utf8 entries missing...

if [ "`grep 'nb_NO\.utf8' rootfs-complete/usr/share/X11/locale/locale.alias`" = "" ];then
echo 'nb_NO.utf8: nb_NO.UTF-8' >> rootfs-complete/usr/share/X11/locale/locale.alias
fi
if [ "`grep 'nn_NO\.utf8' rootfs-complete/usr/share/X11/locale/locale.alias`" = "" ];then
echo 'nn_NO.utf8: nn_NO.UTF-8' >> rootfs-complete/usr/share/X11/locale/locale.alias
fi
if [ "`grep 'ru_UA\.utf8' rootfs-complete/usr/share/X11/locale/locale.alias`" = "" ];then
echo 'ru_UA.utf8: ru_UA.UTF-8' >> rootfs-complete/usr/share/X11/locale/locale.alias
fi


Anyone else who encounters this problem, put an appropriate entry into locale.alias then restart X.

If you use countrywizard to set LANG, then after restarting X, if you open a terminal and just type 'urxvt', it will start with the correct locale and no error message (ditto for the first terminal window).



Posted on 13 Feb 2011, 22:53 by zigbert
utf8
Viewnior works nice when LANG is set to either utf8 or UTF-8 (nb_NO). I can click in rox and image shows up. - That's great, and the most important.

What is somewhat funny is that urxvt won't accept when utf is true. I simply can't type such char - it doesn't show - even I press hard and fast repeatably.....

If I start a new urxvt from another one with the command export LANG=nb_NO; urxvt it accepts the norwegian chars, but then no command will execute with such chars.

Thank you for looking at this topic.

Notes:
- m3u misses MIME setting
- pClock will together with pTiming give a rather complete toolbox for time-tracking. target=_blank>http://www.murga-linux.com/puppy/viewtopic.php?t=64575



Sigmund


Posted on 13 Feb 2011, 24:35 by rodin.s
add ru_RU.utf8
I guess ru_RU.utf8 should also be added to locale.alias along with ru_UA.utf8


Posted on 14 Feb 2011, 9:53 by shinobar
utf8 or UTF-8
utf8 alias fixed is good news.
But still I think we are better to switch '.utf8' to '.UTF-8', considering more compatibility with other distroes and applications.


Posted on 15 Feb 2011, 8:28 by BarryK
ru_RU.utf8
rodin.s,
Thanks, I have added ru_RU.utf8 alias.

shinobar,
Yes, I probably should do it ...sometime, don't feel motivated at present.

Back when I first chose .utf8 instead of .UTF-8, I did some research. There may be some Linux distros that use .utf8, also some unixes. See this IBM page:

http://publib.boulder.ibm.com/infocenter/tsminfo/v6/index.jsp?topic=/com.ibm.itsm.srv.ref.doc/r_opt_server_language.html