Netbeans and Thai language
Netbeans and Thailanguage, Output window.
Serveral days ago..I have a little test on Netbean 5.5
In netbean 5.5 create and application for test whit some "Hello world" but in Thai
"สวัสดีชาวโลก"
---------------------------------------------
public class Main {
public static void main(String[] args) {
System.out.println("สวัสดีชาวโลก");
}
}
---------------------------------------------
then build project i got this error.
---------------------------------------------
Compiling 1 source file to D:\javas\projects\test\build\classesD:\javas\projects\test\src\test\Main.java:28: unmappable character for encoding Cp1252
System.out.println("สวัสดีชาวโล�");
1 errorBUILD FAILED (total time: 0 seconds)
---------------------------------------------
What that!! Um that because default JVM default property "file.encoding" is Cp1252
from http://java.sun.com/j2se/1.4.2/docs/guide/intl/encoding.doc.html
windows-1252 Cp1252 is--> Windows Latin-1
you can check it by printout property by --> System.getProperty("file.encoding");
then how i can solve the problem???
Ans Menu Tools>Options>advanced options>java soucrces>default encoding
set it to UTF8
then compile again you should got BUILD SUCCESSFUL
but
when you run it in netbeans. You will got
สวัสดีชาวโล�
some special font that you can't read in Thai....What da Heck???
Ans netbeans default output use UTF8 then how to fix this?
from project>right click>properties>Run
put this -Dfile.encoding=TIS620 in to Vm Options
then run again.... You still got ÊÇÑÊ´ÕªÒÇâÅ¡ copy it to notepad you should read this
text..??
because
Output window of netbeans cannot set font to other than it default font Monospaced.
สุดเซ็ง ใน Netbean 6 ที่กำลังจะออกก็ยังไม่ได้แก้ตรงนี้ วันนี้เข้าไป request feature นี้แล้ว
แต่ไม่รู้มันจะทำให้หรือเปล่า?? จะแก้เองก็เกรงใจ ไว้ว่างๆ แล้วค่อยมาดูแล้วกัน สุดเซ็ง.
จบข่าว.....
No comments:
Post a Comment