stringi (version 0.2-3)

stri_enc_toascii: Convert To ASCII

Description

This function converts input strings to ASCII, i.e. to character strings consisting of bytes not greater than 127.

Usage

stri_enc_toascii(str)

Arguments

str
character vector to be converted

Value

  • Returns a character vector.

Details

All code points greater than 127 are replaced with ASCII SUBSTITUTE CHARACTER (0x1A). Rencoding declarations are always used to determine which encoding is assumed for each input, see stri_enc_mark. In incorrect byte sequences are found in UTF-8 byte streams, a warning is generated.

A bytes-marked string is assumed to be represented by a 8-bit encoding such that it has ASCII as its subset (a common assumption in R itself).

Note that the SUBSTITUTE CHARACTER (\x1a == \032) may be interpreted as ASCII missing value for single characters.

See Also

Other encoding_conversion: stri_conv, stri_encode; stri_enc_fromutf32; stri_enc_tonative; stri_enc_toutf32; stri_enc_toutf8; stringi-encoding