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

encoding

Encoding information


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

encoding(x)

all_utf8(x)

Arguments

x

A character vector.

Examples

encoding("a")
encoding("\u00fc")
all_utf8(enc2utf8(c("a", "\u00fc")))

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

enc

Portable Tools for 'UTF-8' Character Data

v0.2.2
GPL-3
Authors
Kirill Müller [aut, cre]
Initial release
2019-12-19

We don't support your browser anymore

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