site  contact  subhomenews

utf8 and urxvt

February 13, 2011 — BarryK
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.

Comments

utf8 or UTF-8
Username: shinobar
[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: [quote]# LANG=nb_NO.utf8 urxvt rxvt: the locale is not supported by Xlib, working without locale support.[/quote] Whereas 'LANG=nb_NO.UTF-8' succeeds.

utf8 alias fixed
Username: BarryK
"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: [code]#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 [/code] 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).

utf8
Username: zigbert
"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.....:happy: If I start a new urxvt from another one with the command [i]export LANG=nb_NO; urxvt[/i] 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.http://www.murga-linux.com/puppy/viewtopic.php?t=64575 Sigmund

utf8 or UTF-8
Username: shinobar
"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.

ru_RU.utf8
Username: BarryK
"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


Tags: wary