Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

If you have done much with internationalization then you will have bumped heads with character encodings in Java. In most cases template files and group files are stored in the platforms default character encoding or perhaps even UTF8 (if you are lucky). Changing character encodings manually or accidently via some naïve editor will often result in bad conversion. These converted characters will often appear as queston marks, hollow blocks or a loss of accent symobls. If your colleagues in the advertising department are updating the files and you have changed the character encoding from that of the platform default platform , you are doomed....

Java offers a solution to this problem for source and property files: unicode escapes. A limited set of ANSI/Latin1 characters are used and the remaining "extended" characters are generated using a 6 character escape code of the form \uXXXX, where the X is a hexadecimal digit. The Java SDK provides a tool which can convert from a given platform character encoding to this escaped encoding and back again: native2ascii .

...