Hello There
The following example code works fine.
Output
α
945
This means, i think, that greek chars can be handled. 'α' is displayed.
But the problem arises when i try to read greek chars from input
public static void main(String[] args) { try { BufferedReader in = new BufferedReader(new InputStreamReader(System.in)); String str = ""; while (!str.equals("exit")) { str = in.readLine(); //input is greek 'α' char[] charArr; charArr=str.toCharArray(); for(int i=0;i<str.length();i++){ System.out.println(charArr[i]); //outputs '?' not expected 'α' System.out.print((int)charArr[i]); //and this outputs '63' as for all other greek chars! } } System.exit(0); } catch (IOException e) { } }
Output
?
63
Any ideas why the greek char isn't stored correctly in the array in the first place?