I am using this method to create a java enum for countries.
This compiles fine on my windows dev box, however when building on unix server it fails with this error :
error: unmappable character for encoding UTF8
This is caused by characters such as Å. What is the best way to handle this problem ?
Your source code file obviously uses a different encoding than UTF-8, while the Java compiler on the Unix server is using UTF-8 as default encoding.
Decide on a fixed encoding for your Java source files (probably UTF-8 is the best fit) and tell the Java compiler that the source code is UTF-8 encoded. How to do that, depends on which build system you are using.