UCS2 code (80,81,82 coding) in SIM card
2014-12-04 21:39
417 查看
In the SIM card phone book file (6F3A), the alpha information sometimes needs to code as UCS2, for example to input the Chinese characters or Thai characters, the detail of how to code in UCS2 can be found in GSM11.11, in the part of "Annex B (normative):Coding
of Alpha fields in the SIM for UCS2", can go there to get all the detail, here just give some examples,
example 1, code 81,
Thai: "ผีๆ" in code 81
Unicode of "ผีๆ" is as 0E1C0E350E46, as unicode are two bytes for one character, so the length of the 81 coding is 03, the base pointer is 0x0E00, calculate the Octet 2, get the bits 15 to 8 of the base pointer, it's 00011100, means 0x1C, to make it simple,
left shift one bit of 0x0E, it's 0x1C, the offset value to 0x0E00 of the three characters are 0x1C, 0x35, 0x46, put the bit 8 as 1, then 0x1C, 0x35, 0x46 becomes 0x9C, 0xB5, 0xC6, combine altogether, it's '81'+length+Octet 2+offset value of each characters
= 81 + 03 + 1C + 9C + B5 + C6 = 81031C9CB5C6
so the 81 coding of "ผีๆ" is 81031C9CB5C6.
example 2, code 82,
Chinese "杜杜1"
Unicode of "杜杜1" is 675C675C0031, 82 as code byte, 03 is the length, base pointer as two bytes, 6700, offset value
as 0x5C, 0x5C, 0x31, put the bit 8 as 1, and 0x31 as ASCII code, so remain as 0x31, then the three characters offset value as 0xDC, 0xDC, 0x31, combine altogether as 82+03+6700+DC+DC+31 = 82036700DCDC31
Please refer to this link:
http://hi.baidu.com/yourenpa/item/51067e2ae6f001c2ee10f1df
of Alpha fields in the SIM for UCS2", can go there to get all the detail, here just give some examples,
example 1, code 81,
Thai: "ผีๆ" in code 81
Unicode of "ผีๆ" is as 0E1C0E350E46, as unicode are two bytes for one character, so the length of the 81 coding is 03, the base pointer is 0x0E00, calculate the Octet 2, get the bits 15 to 8 of the base pointer, it's 00011100, means 0x1C, to make it simple,
left shift one bit of 0x0E, it's 0x1C, the offset value to 0x0E00 of the three characters are 0x1C, 0x35, 0x46, put the bit 8 as 1, then 0x1C, 0x35, 0x46 becomes 0x9C, 0xB5, 0xC6, combine altogether, it's '81'+length+Octet 2+offset value of each characters
= 81 + 03 + 1C + 9C + B5 + C6 = 81031C9CB5C6
so the 81 coding of "ผีๆ" is 81031C9CB5C6.
example 2, code 82,
Chinese "杜杜1"
Unicode of "杜杜1" is 675C675C0031, 82 as code byte, 03 is the length, base pointer as two bytes, 6700, offset value
as 0x5C, 0x5C, 0x31, put the bit 8 as 1, and 0x31 as ASCII code, so remain as 0x31, then the three characters offset value as 0xDC, 0xDC, 0x31, combine altogether as 82+03+6700+DC+DC+31 = 82036700DCDC31
Please refer to this link:
http://hi.baidu.com/yourenpa/item/51067e2ae6f001c2ee10f1df
相关文章推荐
- SIM卡中UCS2编码的三种格式(80,81,82)分析
- SIM卡中UCS2编码的三种格式(80,81,82)分析
- SIM卡中UCS2编码的三种格式(80,81,82)分析
- SIM卡中UCS2编码的三种格式(80,81,82)分析
- SIM卡中UCS2编码的三种格式(80,81,82)分析
- 【转】SIM卡中UCS2编码的三种格式(80,81,82)分析
- SIM卡中UCS2编码的三种格式(80,81,82)分析
- SIM卡中UCS2编码的三种格式(80,81,82)分析
- 生于80,81,82,83年的十大尴尬
- 80、81、82
- UnicodeDecodeError: 'rawunicodeescape' codec can't decode bytes in position 80-81: truncated \UXXX
- PLMN coding in SIM
- leecode 解题总结:81. Search in Rotated Sorted Array II
- Avoidhard-coding database passwords in your SAS code
- Avoidhard-coding database passwords in your SAS code - 2
- 【Leet Code】81. Search in Rotated Sorted Array II---Medium
- LeetCode 26, 80, 81, 82, . Remove Duplicates from Sorted Array/ List i, ii
- 生于80,81,82,83年的十大尴尬
- C++ Coding Standards Item 4: Invest in code reviews
- Break Free of Code Deadlocks in Critical Sections Under Windows