Learn R Programming

TAF (version 4.2.0)

file.encoding: File Encoding

Description

Examine file encoding.

Usage

file.encoding(file)

Value

"latin1", "UTF-8", "unknown", or NA.

This function requires the file shell command to be in the path. Otherwise, this function returns NA.

Arguments

file

a filename.

See Also

Encoding examines the encoding of a string.

latin1.to.utf8 converts files from latin1 to UTF-8 encoding.

line.endings examines line endings.

TAF-package gives an overview of the package.

Examples

Run this code
if (FALSE) {
file.base <- system.file(package="base", "DESCRIPTION")
file.nlme <- system.file(package="nlme", "DESCRIPTION")
file.encoding(file.base)  # ASCII
file.encoding(file.nlme)
}

Run the code above in your browser using DataLab