use Encode qw/encode decode/;
$gsm0338 = encode("gsm0338", $utf8); # loads Encode::GSM0338 implicitly
$utf8 = decode("gsm0338", $gsm0338); # ditto
This was once handled by Encode::Bytes but because of all those unusual specifications, Encode 2.20 has relocated the support to this module.
$gsm0338 = encode("gsm0338", $utf8 $chk);
$utf8 = decode("gsm0338", $gsm0338, $chk);
So if you want to check the validity of the encoding, surround the expression with "eval {}" block as follows;
eval {
$utf8 = decode("gsm0338", $gsm0338, $chk);
} or do {
# handle exception here
};
Mapping \x00 to '@' causes too much pain everywhere.
Its use of \x1b (escape) is also very questionable.
Because of those two, the code paging approach used use in ucm-based Encoding SOMETIMES fails so this module was written.