/** * Resolve Java control character sequences with to the actual character value. * Optionally handle unicode escape sequences, too. */ public static String convertFromJavaString(String string, boolean useUnicode) { return CONVERTER.convertFromJavaString(string, useUnicode); }
/** * Resolve Java control character sequences to the actual character value. * Optionally handle unicode escape sequences, too. */ public String convertFromJavaString(String string, boolean useUnicode) { int firstEscapeSequence = string.indexOf('\\'); if (firstEscapeSequence == -1) { return string; } int length = string.length(); StringBuilder result = new StringBuilder(length); appendRegion(string, 0, firstEscapeSequence, result); return convertFromJavaString(string, useUnicode, firstEscapeSequence, result); }