LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
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.

Notices


Reply
  Search this Thread
Old 02-11-2007, 02:01 AM   #1
sadarax
Member
 
Registered: Sep 2005
Distribution: Ubuntu
Posts: 252

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:
http://students.washington.edu/cdobrich/edict.head

Kterm interprets the information properly, and here is the output from within Kterm with 'head dictionary_file':
Quote:
???? /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:
Quote:
�������� /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 08:26 AM. Reason: Found a solution
 
Old 02-11-2007, 08:22 AM   #2
b0uncer
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.
 
  


Reply

Tags
character, console, japanese, konsole, terminal, xterm



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 09:07 PM
Display Japanese characters. Lowe Debian 6 06-10-2005 07:58 PM
printing japanese characters... tw001_tw Linux - Software 0 05-02-2004 10:14 PM
Displaying Japanese characters gjarman Linux - General 1 05-01-2003 05:28 AM
Displaying Japanese characters gjarman Linux - Newbie 0 05-01-2003 01:52 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 03:04 PM.

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