Okay, so I'm using Jbuilder and would like to display Japanese Characters in the console The following is the only way I could manage to get it to display albeit it only displays in a popup:
-----------------
--------------------------------------
import java.util.*;
import java.io.*;
import javax.swing.*;
public class japanesetestclass {
public static void main(String[] args)
throws IOException, FileNotFoundException {
PrintWriter output = new PrintWriter("temp.txt", "Cp933");
System.out.println("ひらがな の けんさ です。u3041");
String test = "ひらがな の けんさ u3041";
System.out.println(test);
output.println( "u3041 おい! レイ です。 よろしく おねがいします。Hey There! Rey Here. Pleasure to make your acquaintance." );
output.println( "Hey There! Rey Here. Pleasure to make your acquaintance." );
output.close();
Scanner input = new Scanner(new File("temp.txt"), "Cp933");
JOptionPane.showMessageDialog(null, input.nextLine());
}
}
-----------------------------------
----------------
I would like to have the Japanese display using system.out.println("xxxx") and not have it as a pop up.
(This is my first Java Class but I'm hoping to have my final project be a program that aids students in learning Japanese Characters. I'm using OS X 10.5.2)
Page 1 of 1
Java Issues... (Java Guru Needed)
#2
Posted 02 June 2008 - 03:01 PM
You probably just need to figure out how to change the character encoding for the console in JBuilder.
Alternatively, you could try to use Unicode encoding in your program instead of "cpp933".
Or your last option, run the code in Terminal.app, it's pretty easy to change the character encoding there.
Alternatively, you could try to use Unicode encoding in your program instead of "cpp933".
Or your last option, run the code in Terminal.app, it's pretty easy to change the character encoding there.
Page 1 of 1



Sign In
Register
Help


MultiQuote