Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

stri_unescape_unicode

Un-escape All Escape Sequences


Description

Un-escapes all known escape sequences

Usage

stri_unescape_unicode(str)

Arguments

str

character vector

Details

Uses ICU facilities to un-escape Unicode character sequences.

The following ASCII standard escapes are recognized: \a, \b, \t, \n, \v, \?, \e, \f, \r, \", \', \\.

Moreover, the function understands the following ones: \uXXXX (4 hex digits), \UXXXXXXXX (8 hex digits), \xXX (1-2 hex digits), \ooo (1-3 octal digits), \cX (control-X; X is masked with 0x1F). For \xXX and \ooo, beware of non-valid UTF-8 byte sequences.

Note that some versions of R on Windows cannot handle characters defined with \UXXXXXXXX. We are working on that.

Value

Returns a character vector. If an escape sequence is ill-formed, result will be NA and a warning will be given.

See Also

Other escape: stri_escape_unicode()

Examples

stri_unescape_unicode('a\\u0105!\\u0032\\n')

stringi

Character String Processing Facilities

v1.6.1
file LICENSE
Authors
Marek Gagolewski [aut, cre, cph] (<https://orcid.org/0000-0003-0637-6028>), Bartek Tartanus [ctb], and others (stringi source code); IBM, Unicode, Inc. and others (ICU4C source code, Unicode Character Database)
Initial release
2021-05-05

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.