Package gw.util
Class GosuEscapeUtil
java.lang.Object
gw.util.GosuEscapeUtil
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic String
escapeForGosuStringLiteral
(char ch) static String
escapeForGosuStringLiteral
(String strText) static String
escapeForGosuStringLiteral
(String strText, int iStart, int iEnd) static String
escapeForHTML
(String string) static String
escapeForHTML
(String string, boolean escapeWhitespace) static String
escapeForJava
(char ch) Converts an escaped character code into a string literal expressing it, e.g.static String
escapeForJava
(String string) Escape any special characters in the string, using the Java escape syntax.static String
getUnicodeEscape
(char ch) private static boolean
isPrintableAscii
(char ch) static String
-
Constructor Details
-
GosuEscapeUtil
public GosuEscapeUtil()
-
-
Method Details
-
escapeForJava
Escape any special characters in the string, using the Java escape syntax. For example any tabs become \t, newlines become \n etc.- Returns:
- the escaped string. Returns the original string unchanged if it contains no special characters.
-
escapeForJava
Converts an escaped character code into a string literal expressing it, e.g. '\n' becomes "\\n".- Parameters:
ch
- Escaped character code.- Returns:
- The string expression of the character code, null if
ch
is not an escaped character. Supports Unicode.
-
escapeForGosuStringLiteral
-
escapeForGosuStringLiteral
-
escapeForGosuStringLiteral
-
isPrintableAscii
private static boolean isPrintableAscii(char ch) -
getUnicodeEscape
-
stripNewLinesAndExtraneousWhiteSpace
-
escapeForHTML
-
escapeForHTML
-