Call the file command line tool with option -i.

file_encoding(path)

Arguments

path

A local file path or glob to check.

Value

A tibble of file encoding.