Posts

Showing posts from May, 2012

Set encoding as UTF 8 in eclipse

Eclipse :- For windows :- 1. Open Run Dialog > "your application" > Common Tab > Console Encoding > Other "set it to UTF-8" 2. Open Run Dialog > "your application" > Arguments Tab > VM Arguments > Add "-Dfile.encoding=UTF-8" and of course Window Menu > General > Workspace > Text file encoding should be set to "UTF-8" then you can run your application ( doesn't matter Standalone or inside Tomcat) Mac Os :- added -Dfile.encoding=UTF-8 to /Applications/eclipse/Eclipse.app/Contents/MacOS/eclipse.ini Eclipse Indigo :- simply by going to Edit > Set Encoding, then choosing UTF-8. e.g. this code will work: public class Hello { public static void main(String [] args) { System.out.println("english letters. русские буквы"); System.out.println("new Date()= " + new Date()); }