SMS Part Counter: Counts the number of SMS parts based on GSM7Bit or UCS-2 Encoding used. The lib can automatically detect the encoding used in the text and count how many chars are used. Based on the number of the char and encoding used, it can easily figure out how many SMS will a particular string might be.
The package can be installed by adding sms_part_counter
to your list of dependencies in mix.exs
:
def deps do
[
{:sms_part_counter, "~> 0.1.3"}
]
end
iex> SmsPartCounter.count_parts("blah blah blah")
%{
"encoding" => "gsm_7bit",
"parts" => 1
}