Never use € (euro) and £ (pound) symbols in a Java src file. If you do you're asking for trouble. Rather use their unicode prepresentation (and possibly a comment telling readers what that unicode represents), that is:
public static final char EURO = '\u20AC';public static final char POUND = '\u00A3';
The main problem occurs when your src is meant to be managed in a windows platform (where encoding is by default Cp1252) and in a Linux platform (where encoding is by default UTF-8).
Unless you have to, then, don't use them. If you really have to, the option is to share between the platforms the same encoding.
You may need to consider
-Dfile.encoding
- Use the same encoding in both platforms by passing to the ant
the encoding attribute - Change the default workspace encoding in eclipse (windows/general/workspace) and set it to UTF-8 (bear in mind that then your € and £ wont be visible anyway)
No comments:
Post a Comment