How can view Japanese Characters using a text editor?

Asked By 0 points N/A Posted on -
qa-featured

Hi,

I am a Java programmer and I have written a program to write Japanese letters in a file as below.

Charset cs = Charset.forName("UTF-8");

String PATH = "C:/tmp/test-file.htm" ;
String STR = "some Japanese text here…";

OutputStreamWriter osw = new OutputStreamWriter(
new FileOutputStream(PATH), cs);
osw.write( STR);
osw.close();

How can I view this using a text editor? What are the free editors support Unicode characters?

I cannot display using notepad.

Thanks.

James

SHARE
Answered By 0 points N/A #124169

How can view Japanese Characters using a text editor?

qa-featured

Hello James,

I can't verify your source code since I'm not a Java programmer. But if your concern is just a text editor that can display characters of different character sets and encoding then I gladly suggest Notepad++. It's freeware and offers a lot more than Windows' default text editor Notepad.

If you want to check it out, here's their homepage: http://notepad-plus-plus.org/

Here's the official documentation on Encoding that are supported in Notepad++ 

http://npp-community.tuxfamily.org/documentation/notepad-user-manual/settings/preferences

I added below a screenshot of Notepad++'s Encoding and Character Sets from the menu. You can convert from one encoding to another. The Japanese character set that it supports is Shift-JIS only.  But if you are programming for Windows then Shift-JIS should be ok for most purposes.

Windows' default text editor Notepad

Here it is in action with Japanese text:

Windows' default text editor Notepad

Hope this helps!

Answered By 562865 points N/A #124170

How can view Japanese Characters using a text editor?

qa-featured

I’m sorry but it will not really display in Microsoft Notepad because the program doesn’t have an option to select in Japanese character sets. Since you are also a programmer that codes using Java, you can use Notepad++. It is a multi-purpose text editor that can be used in writing source codes and understands many different programming languages.

You can download the latest version from Notepad++ Home. Since you are coding in Java, you can set Notepad++ to use the Java programming language. To do this, in Notepad++, click Language, point to letter J, and select Java.

Now, to use the Japanese character set so you can view Japanese characters and symbols, in Notepad++, click Encoding, point to “Character sets”, Japanese, and select “Shift-JIS”.

You should now be able to view Japanese characters and symbols on the editor. To set Notepad++ to use another programming language, click on the Language menu and browse on the different letters related to the programming language.

Login/Register to Answer

Related Questions