S
Stanimir Stamenkov
I've searched the archives but haven't found any useful information.
I'm trying to change the encoding of the default 'System.out' output
stream so I could see some international characters in the text console.
I'm trying this on Win2000:
public class EncodingTest {
public static void main(String[] args) {
String cyrStr = "\u0430\u0431\u0432\u0433\u0434\u0435";
String latStr = "\u00E0\u00E1\u00E2\u00E9\u00EA\u00EB";
System.out.println(System.getProperty("file.encoding"));
System.out.println(cyrStr);
System.out.println(latStr);
JOptionPane.showMessageDialog(null, cyrStr + "\n" + latStr);
System.exit(0);
}
}
So my default encoding seems to be "Cp1251" (because of my regional
settings) and on the command prompt I type:
C:\>chcp 1251
C:\>java EncodingTest
and I get:
Cp1251
абвгде
??????
then I want to see the latin supplement characters and I type:
C:\>chcp 1252
C:\>java -Dfile.encoding=Cp1252 EncodingTest
and I get:
Cp1252
à áâãäå
??????
So is it possible to change the encoding of the default 'System.out'?
I'm trying to change the encoding of the default 'System.out' output
stream so I could see some international characters in the text console.
I'm trying this on Win2000:
public class EncodingTest {
public static void main(String[] args) {
String cyrStr = "\u0430\u0431\u0432\u0433\u0434\u0435";
String latStr = "\u00E0\u00E1\u00E2\u00E9\u00EA\u00EB";
System.out.println(System.getProperty("file.encoding"));
System.out.println(cyrStr);
System.out.println(latStr);
JOptionPane.showMessageDialog(null, cyrStr + "\n" + latStr);
System.exit(0);
}
}
So my default encoding seems to be "Cp1251" (because of my regional
settings) and on the command prompt I type:
C:\>chcp 1251
C:\>java EncodingTest
and I get:
Cp1251
абвгде
??????
then I want to see the latin supplement characters and I type:
C:\>chcp 1252
C:\>java -Dfile.encoding=Cp1252 EncodingTest
and I get:
Cp1252
à áâãäå
??????
So is it possible to change the encoding of the default 'System.out'?