encoding: Encoding information

Description Usage Arguments Examples

View source: R/encoding.R

Description

The encoding function returns "ASCII" if the entire value consists of ASCII symbols only, and works identically to Encoding() otherwise. The all_utf8 function is an efficient variant of all(encoding(x) %in% c("ASCII", "UTF-8")).

Usage

1
2
3

Arguments

x

A character vector.

Examples

1
2
3
4
5
6
encoding("a")
encoding("\u00fc")
all_utf8(enc2utf8(c("a", "\u00fc")))

# Platform-dependent:
all_utf8(enc2native(c("a", "\u00fc")))

Example output

[1] "ASCII"
[1] "UTF-8"
[1] TRUE
[1] TRUE

enc documentation built on Dec. 30, 2019, 1:06 a.m.