Notice that it is possible to formulate invalid escape sequences, e.g. "\u123g" ("g" is not a valid hex character). This is handled by throwing a java.lang.RuntimeException -derived org.codehaus.janino.UnicodeUnescapeException .