Learn R Programming

uchardet (version 1.0.5)

detect_file_enc: Files encoding detection

Description

This function tries to detect character encoding of files.

Usage

detect_file_enc(x)

Arguments

x

Character vector, containing file names or paths.

Value

A character vector of length equal to the length of x and contains guessed iconv-compatible encodings names.

Examples

Run this code
# NOT RUN {
# detect ASCII file encoding
detect_file_enc(system.file("DESCRIPTION", package = "uchardet"))

# paths to examples files
ex_path <- system.file("examples", package = "uchardet")
# various langaues and encodings examples files
ex_files <- Sys.glob(file.path(ex_path, "*", "*"))
# detect files encodings
detect_file_enc(head(ex_files, 10))
# }

Run the code above in your browser using DataLab