GSM-7 encoding for Elixir
def deps do
[
{:gsm, "~> 0.1.0"}
]
endiex> GSM.to_gsm("foo")
"foo"
iex> GSM.to_gsm("bar :]")
"bar :\e>"
iex> GSM.to_gsm("баz")
** (GSM.BadCharacter) Unsupported GSM-7 character: "б"# Test if valid GSM string
iex> GSM.valid?("foo :]")
true
iex> GSM.valid?("баz")
false
# Test if 2-byte GSM character
iex> GSM.double?("|")
true
iex> GSM.double?(":")
falseiex> GSM.to_utf8("foo :\e>")
"foo :]"
iex> GSM.to_utf8("∫")
** (GSM.BadCharacter) Unsupported GSM-7 character: "∫"