UCS2 code (80,81,82 coding) in SIM card

本文详细介绍了如何在SIM卡电话簿文件中使用UCS2编码输入泰文和中文字符。通过两个实例,展示了从Unicode到UCS2编码的具体步骤,并提供了计算过程。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

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

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值