Japanese text in xterm
Howdy all. I'm trying to setup my system to allow me to display Japanese in my xterm, and I've hit a bit of a snag. Basically, I've set everything up, but when I type Japanese characters, all I get are boxes. I know that my input method works, because it works in Firefox (and indeed, many other X applications).
I have compiled my xterm with unicode support, but I'm not sure where to go from here. The Gentoo wiki suggests a font called terminus, which I have tried to use with the '-fn' parameter, but my terminal certainly does not look any different (and since my console is set to use terminus, I know what it looks like, so I expect it to look different).
I've followed every guide I can find online, and tried rvxt-unicode, mlterm, and kterm all to no avail. Because the squares show up, I suspect it's a font issue, but I'm not super experienced in dealing with xterm fonts.
Any suggestions or leads?
I really know nothing about Japanese, but my urxvt displays it just fine. I don't know how the things are currently with xterm... I think that it installs another binary called uxterm, you might have better luck with that. Or maybe 'xterm -u', the two might be equivalente, I suppose.
Originally Posted by Cabhan
As long as your locale supports utf8 and you are using a font that can display all the characters, it should be ok. But no font is that complete, here is where font substitution is relevant, I think.
I don't think it has anything to do with input methods, since I haven't set up anything on that regard, and everything works. XIMs are only useful to input these ideograms, but not to display them.
For example, this is a shot I just made of my urxvt. I pasted a random text from a japanese web site (no idea what it is about, I can't understand it :( ). Pasted it in nano, and then displayed the file with tail on my urxvtc. It just works. I didn't set anything for japanese on my system.
Note, however, that you need utf8 support in your terminal, but also in the app you use to save the files. That is, if the file is encoded incorrectly, the it is corrupted forever and you will not be able to display the original contents. In this case I used nano to save the file. I also use screen, which supports utf8 without problems.
I should perhaps have mentioned that I was using uxterm.
In any event, I installed rxvt, and that allows me to display Japanese text, but when I type it in via uim, it shows up as boxes until I hit enter to finalize it (uim works by showing you the kana as you type them, then letting you convert to kanji before finalizing). That may be the best I manage to get.
Thanks for the advice, though! It's annoying that I try using the same font with uxterm as with urxvt, and the former simply does not work. Grr.
Well, that is probably due to the same font substitution thingy I spoke of above. The problem with non-occidental charsets like this one, if that most font sets do not support them. So, if you look at my screenshot, for example, you will notice that my occidental bits are a regular DejaVu font, while the Japanesse ones are completely unrelated.
Originally Posted by Cabhan
When a program like this can't find a given utf8 char on a given font, it goes searching though all the available ones, and it uses the first (usually) that it can find to represent that character.
So, the problem is not the font you are using, but probably the way that xterm and urxvt handle multiple charsets, utf8 and fonts.
Well, that is the "why", I can't provide a solution, though. But xterm must have a way to configure different fonts for different charsets when using utf8, which is the set to rule them all :P
I hope it made any sense at all. :)