Saturday, August 04, 2007

Domo arigato, ISO-10646-1

A friend gave me a couple of Japanese CDs, which I added to my music collection. When I opened up an XTerm and listed out the directories, I found that the Japanese filenames weren't displayed correctly. Where the characters should have been, there were only empty boxes. Clearly this was a font issue.

As far as I can tell, you only need to add two lines to your .Xresources file:

XTerm*locale: true
XTerm*font: -misc-fixed-medium-r-normal-*-18-120-100-100-c-90-iso10646-1

You could also set the wideFont resource, but I didn't bother. By default, XTerm will simply double the width of the font you specified. For example, the font above has an average width of 90. So the wide font gets a width of 180.

If you want to see which fonts you have at your disposal, run xfontsel and play around with the various pull-down menus.

Then you merge the updated file

xrdb -merge ~/.Xresources

and you're good to go. The next XTerm you open will display Japanese characters perfectly.

No comments: