diff options
Diffstat (limited to 'thirdparty/icu4c/common/util.h')
-rw-r--r-- | thirdparty/icu4c/common/util.h | 20 |
1 files changed, 15 insertions, 5 deletions
diff --git a/thirdparty/icu4c/common/util.h b/thirdparty/icu4c/common/util.h index b5fac383a2..7e6d356899 100644 --- a/thirdparty/icu4c/common/util.h +++ b/thirdparty/icu4c/common/util.h @@ -55,14 +55,17 @@ class U_COMMON_API ICU_Utility /* not : public UObject because all methods are s /** * Return true if the character is NOT printable ASCII. - * - * This method should really be in UnicodeString (or similar). For - * now, we implement it here and share it with friend classes. + * The tab, newline and linefeed characters are considered unprintable. */ static UBool isUnprintable(UChar32 c); /** - * Escape unprintable characters using \uxxxx notation for U+0000 to + * @return true for control codes and for surrogate and noncharacter code points + */ + static UBool shouldAlwaysBeEscaped(UChar32 c); + + /** + * Escapes one unprintable code point using \uxxxx notation for U+0000 to * U+FFFF and \Uxxxxxxxx for U+10000 and above. If the character is * printable ASCII, then do nothing and return false. Otherwise, * append the escaped notation and return true. @@ -70,6 +73,13 @@ class U_COMMON_API ICU_Utility /* not : public UObject because all methods are s static UBool escapeUnprintable(UnicodeString& result, UChar32 c); /** + * Escapes one code point using \uxxxx notation + * for U+0000 to U+FFFF and \Uxxxxxxxx for U+10000 and above. + * @return result + */ + static UnicodeString &escape(UnicodeString& result, UChar32 c); + + /** * Returns the index of a character, ignoring quoted text. * For example, in the string "abc'hide'h", the 'h' in "hide" will not be * found by a search for 'h'. @@ -199,7 +209,7 @@ class U_COMMON_API ICU_Utility /* not : public UObject because all methods are s * position. Return the identifier, or an empty string if there * is no identifier. * @param str the string to parse - * @param pos INPUT-OUPUT parameter. On INPUT, pos is the + * @param pos INPUT-OUTPUT parameter. On INPUT, pos is the * first character to examine. It must be less than str.length(), * and it must not point to a whitespace character. That is, must * have pos < str.length() and |