1Encode::GSM0338(3) User Contributed Perl Documentation Encode::GSM0338(3)
2
3
4
6 Encode::GSM0338 -- ESTI GSM 03.38 Encoding
7
9 use Encode qw/encode decode/;
10 $gsm0338 = encode("gsm0338", $utf8); # loads Encode::GSM0338 implicitly
11 $utf8 = decode("gsm0338", $gsm0338); # ditto
12
14 GSM0338 is for GSM handsets. Though it shares alphanumerals with ASCII,
15 control character ranges and other parts are mapped very differently,
16 mainly to store Greek characters. There are also escape sequences
17 (starting with 0x1B) to cover e.g. the Euro sign.
18
19 This was once handled by Encode::Bytes but because of all those unusual
20 specifications, Encode 2.20 has relocated the support to this module.
21
23 Unlike most other encodings, the following always croaks on error for
24 any $chk that evaluates to true.
25
26 $gsm0338 = encode("gsm0338", $utf8 $chk);
27 $utf8 = decode("gsm0338", $gsm0338, $chk);
28
29 So if you want to check the validity of the encoding, surround the
30 expression with "eval {}" block as follows;
31
32 eval {
33 $utf8 = decode("gsm0338", $gsm0338, $chk);
34 } or do {
35 # handle exception here
36 };
37
39 ESTI GSM 03.38 Encoding itself.
40
41 Mapping \x00 to '@' causes too much pain everywhere.
42
43 Its use of \x1b (escape) is also very questionable.
44
45 Because of those two, the code paging approach used use in ucm-based
46 Encoding SOMETIMES fails so this module was written.
47
49 Encode
50
51
52
53perl v5.30.0 2019-07-26 Encode::GSM0338(3)