Non-ASCII chars in Java

Posted: November 29th, 2010 | Author: | Filed under: Uncategorized | Tags: , | No Comments »

If you are having problems with non-ASCII characters (for example the Danish æ, ø and å) not showing up correctly in your Java application, try giving the Java VM the following argument:

-Dfile.encoding=UTF-8

You can verify that the charset has been set with this statement:

Charset.defaultCharset();