View source: R/guess_file_encoding.R
guess_file_encoding | R Documentation |
This function will guess the file encoding of a vector of filenames or
filepaths and return the file encoding as a string. It primarily uses
stringi::stri_enc_detect()
to guess the encoding. Additionally, it
searches for known CP850 and CP1252 characters and will return the
appropriate encoding if found, because ICU/stringi cannot detect them. If a
file is a binary file, it will return "binary"
. If a file is inaccessible
it will return NA
for that element.
guess_file_encoding(filepaths, threshold = 0.2)
filepaths |
A character vector |
threshold |
A single element numeric (minimum confidence level of the guess [0-1]) |
A character vector the same length as filepaths
.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.