Share your knowledge at the LQ Wiki.
Go Back > Forums > Linux Forums > Linux - Software
User Name
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.


  Search this Thread
Old 02-11-2007, 03:01 AM   #1
Registered: Sep 2005
Distribution: Ubuntu
Posts: 249

Rep: Reputation: 30
(SOLVED) Terminal problems with Japanese characters

EDIT: Fixed

I am having some trouble getting Japanese text to show up properly inside my terminal/console. I do not want to use Kterm because it does not have some necessary features. Basically, I just want to know how to get something like mrxvt or konsole or xterm to work with this particular text properly.

I am running Ubuntu 6.10, and I have the Japanese language packs installed. Here is the basic problem:

I have a dictionary file that I am going to parse text from, but normal consoles (xterm, KDE's konsole) do not see the Japanese properly text when I do 'head dictionary_file' (I'm using Jim Breen's edict file) or anything else to output to the console. My consoles do work if I write in Japanese into them (both hiragana, katakana and kanji). I just cannot seem to get the text from this file.

Here is a small sample of the file:

Kterm interprets the information properly, and here is the output from within Kterm with 'head dictionary_file':
???? /EDICT, EDICT_SUB(P), EDICT2 Japanese-English Electronic Dictionary Files/Copyright Electronic Dictionary Research & Development Group - 2006/Created: 2007-02-11/
ヽ [くりかえし] /(n) repetition mark in katakana/
ヾ [くりかえし] /(n) voiced repetition mark in katakana/
ゝ [くりかえし] /(n) repetition mark in hiragana/
ゞ [くりかえし] /(n) voiced repetition mark in hiragana/
〃 [おなじく] /(n) ditto mark/
仝 [どうじょう] /(n) "as above" mark/
々 [くりかえし] /(n) repetition of kanji (sometimes voiced)/
〆 [しめ] /(n) end or closure mark/
〆切 [しめきり] /(n) closing/cut-off/end/deadline/Closed/No Entrance/
This is what is shows up like on other consoles:
�������� /EDICT, EDICT_SUB(P), EDICT2 Japanese-English Electronic Dictionary Files/Copyright Electronic Dictionary Research & Development Group - 2006/Created: 2007-02-11/
�� [���꤫����] /(n) repetition mark in katakana/
�� [���꤫����] /(n) voiced repetition mark in katakana/
�� [���꤫����] /(n) repetition mark in hiragana/
�� [���꤫����] /(n) voiced repetition mark in hiragana/
�� [���ʤ���] /(n) ditto mark/
�� [�ɤ����礦] /(n) "as above" mark/
�� [���꤫����] /(n) repetition of kanji (sometimes voiced)/
�� [����] /(n) end or closure mark/
���� [���᤭��] /(n) closing/cut-off/end/deadline/Closed/No Entrance/

If there is a problem with the dictionary_file itself, like perhaps it has been encoded strangely and needs to be altered, that is an option I would be happy to explore, but I really do not know if that is the root of the issue.

I tried custom compiling mrxvt from source with every variation of the options I could find the ./configure --help list, but nothing seems to work and they all give me garbage output. Again, I basically just want to know how to get something like mrxvt or konsole or xterm to work with the text properly.

EDIT: I figured out that the dictionary file was encoded using EUC, which is obviously wrong. So I used a program called 'nkf' to convert the text to UTF-8.

Last edited by sadarax; 02-11-2007 at 09:26 AM. Reason: Found a solution
Old 02-11-2007, 09:22 AM   #2
LQ Guru
Registered: Aug 2003
Distribution: CentOS, OS X
Posts: 5,131

Rep: Reputation: Disabled
Or you could do it the other way around; open the file and in the editor, if it lets you (like Bluefish for example), set the encoding of the file to be 'nkf' (or one that works with it), and after that the editor should know how to deal with the letters. Your way is of course working, as long as you remember that where ever the file is being used, the encoding in the file must work with the software that is using it. It the software expects the file to be encoded in 'nkf' and not UTF-8, you might get into trouble.

A note: if and when you solve the problem, it's a good habit to write instructions (short or longer) that tell how you got around the problem, fixed it or got the situation better. Or at least where you got the information to do it; this helps other people with similar problems to get their own cases solved. And after this change the topic of the thread so that it reads something like [SOLVED] in it, so people know the thing is solved.


character, console, japanese, konsole, terminal, xterm

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Input of Japanese characters LostInTranslation Linux - General 3 10-29-2005 10:07 PM
Display Japanese characters. Lowe Debian 6 06-10-2005 08:58 PM
printing japanese characters... tw001_tw Linux - Software 0 05-02-2004 11:14 PM
Displaying Japanese characters gjarman Linux - General 1 05-01-2003 06:28 AM
Displaying Japanese characters gjarman Linux - Newbie 0 05-01-2003 02:52 AM

All times are GMT -5. The time now is 07:06 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration