[
Date Prev][
Date Next][
Thread Prev][
Thread Next][
Date Index][
Thread Index]
[
List Home]
Re: [aspectj-users] help! problem about encoding
|
Zhang,
What is the default character set for files created in your Eclipse?
Set it to UTF-8 or UTF-16, and then specify the ajc compiler to let it know what the source file encoding is.
ajc -encoding UTF-8 or
ajc -encoding UTF-16
You can specify the encoding option through AJDT.
This is similar to the behavior of javac.
You may already know this, but System.out.println output may work fine in the console output of Eclipse, but may not work if your command console (cmd windows) does not support unicode or multi-byte character.
So, ususally I write the output to a file using java's output stream with explicit specification of the encoding.
Monal
On 1/8/07, Heping Zhang <phoenix.zhp@xxxxxxxxx> wrote:
Mr. Webster,
Thanks for your reply. I use aspectj-1.5.3 and build the project in elipse 3.2.0. I build a new aspectj project, then add a test.java class to the src folder, which include the "main" method and println some Chinese character. But the output seems encoded incorrectly. And just as you presume, after I converted the project to a java project using aspectj tools in eclipse, the output became correct. In the aspectj project, I have tried "
System.out.println(new String(s1.getBytes("gbk"), "utf-8"));", "System.out.println("unicode: " + new String("你好".getBytes("unicode")));" and and so forth. But they did not work as I except. Tht result still incorrect. I also have tried set the "non-standard compiler options" in aspectj compiler panel to "-encoding GBK" but it did not work, too. I worked on this problem for nearly two days and now I do not what I can do on earth. Can you help me?
Thank you very much!
Heping Zhang
_______________________________________________
aspectj-users mailing list
aspectj-users@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/aspectj-users