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?