enc (version 0.2.0)

utf8: A simple class for storing UTF-8 strings

Description

The values are stored as a character() vector. On construction, the enc2utf8() function is called on the input. Subsetting and concatenation operations on an object of this class return an object of this class again. Calls to Encoding<-() are not intercepted.

Usage

utf8(x = character())

is_utf8(x)

as_utf8(x, ...)

# S3 method for default as_utf8(x, ...)

# S3 method for NULL as_utf8(x, ...)

# S3 method for character as_utf8(x, ...)

# S3 method for utf8 as_utf8(x, ...)

# S3 method for utf8 as.character(x, ...)

# S3 method for utf8 as.data.frame(x, row.names = NULL, optional = FALSE, ..., nm = paste(deparse(substitute(x), width.cutoff = 500L), collapse = " "))

# S3 method for utf8 format(x, ...)

# S3 method for utf8 print(x, ...)

Arguments

x

A vector

...

Arguments passed on to further methods.

row.names

NULL or a character vector giving the row names for the data frame. Missing values are not allowed.

optional

logical. If TRUE, setting row names and converting column names (to syntactic names: see make.names) is optional. Note that all of R's base package as.data.frame() methods use optional only for column names treatment, basically with the meaning of data.frame(*, check.names = !optional).

nm

Name of column in new data frame

Examples

Run this code
# NOT RUN {
utf8(letters)
utf8("<U+00E4>")
utf8(iconv("<U+00E4>", to = "latin1"))
# }

Run the code above in your browser using DataLab