View Source CharsetDetect (CharsetDetect v0.1.1)

CharsetDetect is a simple wrapper around the chardetng crate.

Summary

Functions

Guess the encoding of a string.

Guess the encoding of a string (exceptional).

Functions

@spec guess(binary()) :: {:ok, String.t()} | {:error, String.t()}

Guess the encoding of a string.

Examples

iex> File.read!("test/assets/sjis.txt") |> CharsetDetect.guess
{:ok, "Shift_JIS"}
@spec guess!(binary()) :: String.t()

Guess the encoding of a string (exceptional).

Examples

iex> File.read!("test/assets/big5.txt") |> CharsetDetect.guess!
"Big5"