guess_encoding {readr} | R Documentation |
Uses stri_enc_detect
: see the documentation there
for caveats.
guess_encoding(file, n_max = 10000, threshold = 0.2)
file |
Either a path to a file, a connection, or literal data (either a single string or a raw vector). Files ending in Literal data is most useful for examples and tests. It must contain at least one new line to be recognised as data (instead of a path). |
n_max |
Number of lines to read. If |
threshold |
Only report guesses above this threshold of certainty. |
guess_encoding(readr_example("mtcars.csv")) guess_encoding("a\n\u00b5\u00b5")