Learn R Programming

icesTAF (version 3.6.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. If the file utility is not found in the path, this function looks for it inside c:/Rtools/bin. If the required software is not installed, 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.

icesTAF-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