Skip to content

Commit

Permalink
Fix #490
Browse files Browse the repository at this point in the history
  • Loading branch information
gagolews committed Nov 7, 2023
1 parent 3687821 commit e13b826
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 24 deletions.
23 changes: 11 additions & 12 deletions R/escape.R
Original file line number Diff line number Diff line change
Expand Up @@ -35,20 +35,22 @@
#' Escape Unicode Code Points
#'
#' @description
#' Escapes all Unicode (not ASCII-printable) code points.
#' Generates an ASCII string where all non-printable characters
#' and non-ASCII characters are converted to escape sequences.
#'
#' @details
#'
#' For non-printable and certain special (well-known,
#' see also R man page \link{Quotes})
#' ASCII characters the following
#' see also the R man page \link{Quotes})
#' ASCII characters, the following
#' (also recognized in R) convention is used.
#' We get \code{\\a}, \code{\\b}, \code{\\t}, \code{\\n}, \code{\\v},
#' \code{\\f}, \code{\\r}, \code{\"}, \code{\'}, \code{\\\\}
#' or either \code{\\uXXXX} (4 hex digits) or \code{\\UXXXXXXXX} (8 hex digits)
#' otherwise.
#'
#'
#' As usual, any input string is converted to Unicode
#' As usual in stringi, any input string is converted to Unicode
#' before executing the escape process.
#'
#'
Expand All @@ -72,16 +74,14 @@ stri_escape_unicode <- function(str)
#' Un-escape All Escape Sequences
#'
#' @description
#' Un-escapes all known escape sequences
#' Un-escapes all known escape sequences.
#'
#' @details
#' Uses \pkg{ICU} facilities to un-escape Unicode character sequences.
#' Uses \pkg{ICU}'s facilities to un-escape Unicode character sequences.
#'
#' The following ASCII standard escapes are recognized:
#' The following escape sequences are recognized:
#' \code{\\a}, \code{\\b}, \code{\\t}, \code{\\n}, \code{\\v}, \code{\\?},
#' \code{\\e}, \code{\\f}, \code{\\r}, \code{\"}, \code{\'}, \code{\\\\}.
#'
#' Moreover, the function understands the following ones:
#' \code{\\e}, \code{\\f}, \code{\\r}, \code{\"}, \code{\'}, \code{\\\\},
#' \code{\\uXXXX} (4 hex digits),
#' \code{\\UXXXXXXXX} (8 hex digits),
#' \code{\\xXX} (1-2 hex digits),
Expand All @@ -91,14 +91,13 @@ stri_escape_unicode <- function(str)
#'
#' Note that some versions of R on Windows cannot handle
#' characters defined with \code{\\UXXXXXXXX}.
#' We are working on that.
#'
#' @param str character vector
#'
#' @return
#' Returns a character vector.
#' If an escape sequence is ill-formed,
#' result will be \code{NA} and a warning will be given.
#' the result will be \code{NA} and a warning will be given.
#'
#' @examples
#' stri_unescape_unicode('a\\u0105!\\u0032\\n')
Expand Down
9 changes: 5 additions & 4 deletions man/stri_escape_unicode.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

13 changes: 5 additions & 8 deletions man/stri_unescape_unicode.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit e13b826

Please sign in to comment.