Uses stringi::stri_enc_detect()
: see the documentation there
for caveats.
guess_encoding(file, n_max = 10000, threshold = 0.2)
file | A character string specifying an input as specified in
|
---|---|
n_max | Number of lines to read. If |
threshold | Only report guesses above this threshold of certainty. |
A tibble
#> # A tibble: 1 x 2 #> encoding confidence #> <chr> <dbl> #> 1 ASCII 1#> # A tibble: 1 x 2 #> encoding confidence #> <chr> <dbl> #> 1 ASCII 1#> # A tibble: 1 x 2 #> encoding confidence #> <chr> <dbl> #> 1 ASCII 1guess_encoding("a\n\u00b5\u00b5")#> # A tibble: 1 x 2 #> encoding confidence #> <chr> <dbl> #> 1 UTF-8 0.8