using AT commands. of service in response encoding and read Chinese or Arabic for Nokia phones -


i developing application gsm modems using @ commands. have problem reading unicode messages or ussd example: dcs=17 not 7 or 15 or 72

two years ago, , i'm looking solution no availi able find partial solution through use of chinese phone phone can read chinese codingbut nokia phones not support codec arabic or chineseand service responses appear incomprehensible symbols example:

+cusd: 0,"ar??c  ?j <10???@d@??? @0@??@d? ?z?xb  @   $@?@?@z@@?? @-@h?@???@b@@$? @3@h?p???@??(??",17 

but when use phone shows chinese response service correctly 100% how address coding through nokia phones or other

the character set used strings in @ commands controlled at+cscs. default value "gsm" not capable of displaying outside relative limited set of characters.

in case, read arabic or chinese "utf-8" best choice, although "ucs-2" can used (will require little post processing though).

below can see how selected character set affects strings. have kept phone number chinese teacher when lived in taiwan, stored "teacher" in chinese (lǎo shī). actual phone number stripped out here, otherwise following verbatim copy of responses phone:

$ echo at+cscs? | atinout - /dev/ttyacm0 -  +cscs: "gsm"  ok $ echo at+cpbr=403 | atinout - /dev/ttyacm0 -  +cpbr: 403,"",145,"??/m"  ok $ echo at+cscs=? | atinout - /dev/ttyacm0 -  +cscs: ("gsm","ira","8859-1","utf-8","ucs2")  ok $ echo 'at+cscs="utf-8"' | atinout - /dev/ttyacm0 -  ok $ echo at+cscs? | atinout - /dev/ttyacm0 -  +cscs: "utf-8"  ok $ echo at+cpbr=403 | atinout - /dev/ttyacm0 -  +cpbr: 403,"",145,"老師/m"  ok $ echo 'at+cscs="ucs2"; +cpbr=403' | atinout - /dev/ttyacm0 -  +cpbr: 403,"",145,"80015e2b002f004d"  ok $ echo 'at+cscs=?' | atinout - /dev/ttyacm0 -  +cscs: ("00470053004d","004900520041","0038003800350039002d0031","005500540046002d0038","0055004300530032")  ok $ echo 'at+cscs="005500540046002d0038"' | atinout - /dev/ttyacm0 -  ok $ echo 'at+cscs=?' | atinout - /dev/ttyacm0 -  +cscs: ("gsm","ira","8859-1","utf-8","ucs2")  ok 

update, upon checking 27.007, string +cusd: <m>[,<str>,<dcs>] unsolicited result code not regular string, has own encoding:

<str>: string type ussd-string (when <str> parameter not given,        network not interrogated):   - if <dcs> indicates 3gpp ts 23.038 [25] 7 bit default alphabet used:       - if te character set other "hex" (refer command select te character         set +cscs): mt/ta converts gsm alphabet current te character set         according rules of 3gpp ts 27.005 [24] annex        - if te character set "hex": mt/ta converts each 7-bit character of gsm         alphabet 2 ira character long hexadecimal number (e.g. character         Π (gsm 23) presented 17 (ira 49 , 55))    - if <dcs> indicates 8-bit data coding scheme used: mt/ta converts each     8-bit octet 2 ira character long hexadecimal number (e.g. octet     integer value 42 presented te 2 characters 2a (ira 50 , 65))  <dcs>: 3gpp ts 23.038 [25] cell broadcast data coding scheme in integer format (default 0) 

you therefore have first determine if dcs 7 or 8 bit, , decode according above.


ps, "usc2 0x81" format described here. although should not behave differently plain ucs2 in particular case.


Comments

Popular posts from this blog

php - Why I am getting the Error "Commands out of sync; you can't run this command now" -

linux - Does gcc have any options to add version info in ELF binary file? -

java - Are there any classes that implement javax.persistence.Parameter<T>? -