Java and JavaScript (.js) source files can use any character encoding. If one programmer uses UTF-8 and the other ISO encoding, there is a chance you will end with something like "Ren�" or "René" instead of "René". The most reliable way to avoid all conversion errors is to encode all special characters with escape sequences. JavaScript allows both hex (e.g. \xFF) and Unicode escape sequences (e.g. \u0100) in string literals while Java allows Unicode escape sequences only.

This encoding utility requires JavaScript.
Created by Thiemo Mättig in January 2012 for
Show the source of this page or visit the Gist at GitHub.