I used to know that there is a limit of 70 characters for sending text messages, but I still don't know it when I use it. How many characters are there in Chinese and English? In the beginning, according to the old idea, the GB code is a Chinese character, two bytes in English.
In bytes, up to 140 bytes can be sent according to the limit of 70 Chinese characters, but an error always occurs during sending. Later, I checked the text message code on the Internet to find out. Now I usually use the PDU mode to send text messages.
Section:
In PDU
In mode, three encoding methods can be used to encode the sent content: 7-bit, 8-bit, and ucs2. 7-bit encoding is used to send Common ASCII characters,
It encodes a string of 7-bit characters (the highest bit is 0) into 8-bit data, each 8 characters can be "COMPRESSED" into 7; 8-bit encoding is usually used to send data messages, such as slices and ringtones;
The ucs2 encoding is used to send Unicode characters. The maximum size of the user information (TP-UD) segment of the PDU string is 140 bytes, so the maximum size of short messages that can be sent in these three encoding modes
The numbers of characters are 160, 140, and 70. Here, an English letter, a Chinese character, and a Data byte are regarded as a character. Note that the user information length of the PDU string (TP-
Udl) in different encoding methods. 7-bit encoding refers to the number of characters of the original Short Message, rather than the number of bytes After encoding. 8-bit encoding is the number of bytes. Ucs2
It is also the number of bytes, which is twice the number of characters of the original short message.
Now I understand that the ucs2 encoding is used for sending text messages with Chinese characters. Both Chinese and English characters and space characters are counted as one character. A total of 70 messages are generated. An error occurs when more than one text message is sent. When a text message is sent in English, it uses 7-bit encoding to send 160 characters.
Smsmanager hasThe dividemessage function divides the string into messages that can be sent according to the limit.
If there is a Chinese Text Message followed by a URLDividemessage is not a good mechanical score. You need to put the URL in a separate text message,In this case, you need to manually score the score.
Http://www.cnblogs.com/developer-OYK/