I use weird Unicode strings in my Java test cases. The compiler seemingly interprets the file as iso-8859-1, causing JUnit to complain.
In Python I can specify the encoding at the top of the file:
# -*- coding: utf-8 -*-
Is there an equivalent in Java? How can I detect / specify the encoding of .java files?
You can set it when you compile the file with the parameter “-encoding”
http://docs.oracle.com/javase/6/docs/technotes/tools/windows/javac.html