@Deprecated public final class UnicodeEncoder extends Object
Modifier and Type | Method and Description |
---|---|
static String |
escape(String str)
Deprecated.
Converts the characters in the given string (except for those in a small
character class) to their
\\uXXXX equivalent. |
static StringBuilder |
escape(StringBuilder target,
String str)
Deprecated.
Converts the characters in the given string (except for those in a small
character class) to their
\\uXXXX equivalent and appends them to
the given StringBuilder . |
static String |
unescape(String escapedStr)
Deprecated.
Unescapes the given string.
|
static StringBuilder |
unescape(StringBuilder target,
String escapedStr)
Deprecated.
Converts a \\uXXXX escaped char into its real equivalent (takes also \n
\t \r) [from java.util.Properties with small modifications]
|
public static String escape(String str)
\\uXXXX
equivalent.
Newlines, tabs and carriage returns are escaped as in Java, i.e. to
\\n
, \\t
and \\r
. Numbers, letters, the dash,
underscore and period characters are not converted.
str
- The string to convert.escape(StringBuilder, String)
public static StringBuilder escape(StringBuilder target, String str)
\\uXXXX
equivalent and appends them to
the given StringBuilder
.
Newlines, tabs and carriage returns are escaped as in Java, i.e. to
\\n
, \\t
and \\r
. Numbers, letters, the dash,
underscore and period characters are not converted.
target
- The StringBuilder
to which the escaped string is to be
appended.str
- The string to convert.StringBuilder
reference that was passed in, i.e.
buffer.escape(String)
public static String unescape(String escapedStr)
escapedStr
- A Unicode-encoded string.unescape(StringBuilder, String)
public static StringBuilder unescape(StringBuilder target, String escapedStr)
Copyright © 2021 RWS Group for and on behalf of its affiliates and subsidiaries. All rights reserved.