Learn R Programming

fpeek (version 0.2.0)

peek_guess_encoding: Guess File Encoding

Description

Detect the encoding of a text file. This function is a wrapper around guess_encoding from the readr package, returning the best candidate as a character string.

readr must be installed (it is listed in Suggests). If it is not available, the function stops with an informative message.

Usage

peek_guess_encoding(path)

Value

a character string giving the most likely encoding.

Arguments

path

path to the text file.

Examples

Run this code
if (FALSE) {
f <- system.file(package = "fpeek",
  "datafiles", "cigfou-ISO-8859-1.txt")
peek_guess_encoding(f)
}

Run the code above in your browser using DataLab