Looking for advice on terminal emulator. Utf-8 is not displayed well
SlackwareThis Forum is for the discussion of Slackware Linux.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
If you get an error message, the encoding is probably wrong. Else, it's probably right.
EDIT. I was wrong, sorry. Discard this tip.
PS There's more than one way to skin a cat, and to produce man pages as well. If there is a formatting error in the result: as many steps in the pipe, as many culprits.
Last edited by Didier Spaier; 11-25-2014 at 05:34 AM.
Reason: PS added.
uxterm displays utf-8 characters, and so does MC used in uxterm!
Enjoy
Oh, that was Slack. So simple and effective. I hadn't realized it was in front of my nose
Now, if anyone knows why xmessage still displays these strange characters... I haven't found anything in the man pages, only after a search in ddg.gg (xmessage utf-8), some german guy who boasts that setting:
Code:
*international: true
in ~/.Xresources (?) (I've never edited that file) will make the thing work as "advertised".
I'm dubious about setting any option in my system before having any more information about what it really serves for.
BTW, very instructive this discussion about terminals emulators, encodings, man pages... a little too much technical for me, I must admit. I'll have a look at your recommendations.
Last edited by PreguntoYo; 11-25-2014 at 01:11 PM.
Here's my xmessage resources (for $HOME/.Xresources). I just added international: to see if it works, and it does.
Code:
! xmessage
Xmessage*font: -*-dejavu sans mono-*-*-*-*-*-140-*-*-*-*-*-*
! Xmessage.geometry: -0+0
Xmessage.center: true
Xmessage.Form.Command.shapeStyle: Rectangle
Xmessage.Form.okay.foreground: green
Xmessage.Form.cancel.foreground: red
Xmessage.Form.?.foreground: #a0c0e0
Xmessage*background: black
Xmessage*foreground: #a0c0e0
Xmessage*defaultButton: okay
Xmessage*international: true
Unfortunately, "international: true" seems to break Xmessage*font's ability to set the font. I'm guessing that either there's a separate resource to specify the international mode font, or I'm missing something else. 'xmessage' doesn't seem particularly well documented, so I'm having a hard time finding it.
fc-list | xmessage -file - is a good way of testing.
Update: I was right, looks like *international:true uses *fontSet rather than *font.
Had a brief play around, seems to work ok, but it seems that running xmessage under en_GB.utf-8 results in a larger line spacing than en_GB.iso8859-*, and I've not figured that one out yet.
I'm setting my own minimalistic desktop, based on Fluxbox.
There are various terminal emulators that come installed with Slackware: Konsole, Xfce's Terminal... I don't want to use these, they're tied (?) to their respective desktop environments.
I've been trying xterm and rvxt (this last only a little), but they don't seem to display utf-8 characters well. Midnight Commander is unusable, man pages show strange characters where accented vowels should go. Hell, there are strange chars shown even when xmessage tries to display the "About Fluxbox" in my language.
I don't know if all these strange symptoms are all caused by one or more misconfigured options. I thought it could be the terminal emulator, at least. I'm unsure about xmessage.
I have the LANG variables in lang.sh and lang.csh set to es_ES.utf8. Also I have set the XkbLayout to "es" in the /etc/X11/xorg.conf.d/90-keyboard-layout.conf file. I don't know if I could do anything else.
Do you know if the problem would be only in the terminal emulator?. If so, which one would you suggest?. Could I just solve my problems setting some mystical option out there?.
I'm clueless Help needed.
As astrogeek suggests, use rxvt-unicode. If you want a terminal multiplexer as well - which allows you, among other things, to create multiple windows and/or panes within your terminal emulator - then use tmux in addition to rxvt-unicode. Google "tmux tutorial".
~/.Xresources is a file which is used to configure the appearance of X programs - xterm, rxvt-unicode, xpdf, xclock, xcalc, and so on. On first run rxvt-unicode starts with a bland set of colours and fonts, but it can be customized to your liking, by editing ~/.Xresources. The Arch wiki has a good introduction to this.
DejaVu is a good terminal font if you need more than what the standard ASCII scheme offers.
If you make changes to your .Xresources file and want to load them on the fly you can do so as follows:
'man' seems to cause problems for me using the terminus font on a virtual console. In a utf-8 locale man/groff appears to use 'hyphen' (U+2010) when it needs to split a word at a line end. A iso8859-1 locale appears to generate a 'hyphen-minus' (U+002D) for this; both despite their being a 'soft-hyphen' (U+00AD) in both unicode and 8859-1 encodings intended specifically for this purpose! (oh well. ).
Out of curiosity I just opened the source tarball of groff-1.22.3 (just upgraded in -current) and found this in the file named PROBLEMS:
Code:
* The UTF-8 output of grotty has strange characters for the minus, the
hyphen, and the right quote. Why?
The used Unicode characters (U+2212 for the minus sign and U+2010 for
the hyphen) are the correct ones, but many programs can't search them
properly. The same is true for the right quote (U+201D). To map
those characters back to the ASCII characters, insert the following
code snippet into the `troffrc' configuration file:
.if '\*[.T]'utf8' \{\
. char \- \N'45'
. char - \N'45'
. char ' \N'39'
.\}
If not that, something similar?
More generally, this file is worth reading IMHO.
Last edited by Didier Spaier; 12-02-2014 at 07:36 AM.
Thanks Didier, I solved the hyphen issue by mapping u2010 to u002d in the fonts unicode map, which will have the advantage of also working for programs other than man/troff that may end up throwing a u2010 at the console driver, so I'm happy with the solution I have, but thanks for the info: it's good to know how to do this for troff itself, and it made me aware of the other two affected characters, so I'll probably do something similar for those in my unicode map.
I highly recommend the DejaVu font collection for nearly all alphabetic scripts, see the documents in /usr/doc/dejavu-fonts-ttf-2.34, especially README, langcover.txt and unicover.txt.
The great advantage of using true type fonts is that they are fully scalable, i.e. you can get exactly the size you want. Only limit: the dimensions (height and length) of a single character shouldn't exceed that of the screen
The TTY fonts can also be used on a console (without X) if you use e.g. fbterm
Of course people reading Chinese can get 35000+ more glyphs using the WenQuanYi Zen Hei font see the documents in /usr/doc/wqy-zenhei-font-ttf-0.8.38. There are others, see in the directories listed with ls /usr/doc|grep ttf.
BTW thanks to Alien BOB who introduced material for CJK in Slackware.
Last edited by Didier Spaier; 12-02-2014 at 11:18 AM.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.