zbkoong / android-rcs-ims-stack

Automatically exported from code.google.com/p/android-rcs-ims-stack
0 stars 0 forks source link

Content-Leght calculation for non latin characters #46

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Send a chat message with non-latin character(s)

What is the expected output? What do you see instead?
Content-Length with correct number of characters. Currently incorrect number is 
included.

What version of the product are you using? On what operating system?
2.3.4, Android 2.3.3

Please provide any additional information below.
Example is with sending a text message with content of "cześć" which in 
Polish means "hi". It contains two special characters - "ść". 
Characters are encoded using UTF-8 (octal) which is visible in trace as 
"cze\305\233\304\207". Content-Length is calculated as 5 (which is true for a 
human) but really is 7 (two special characters are encoded as 4 - 
\305\233\304\207).
A strict SBC or application of other party may reject such message.
Example below (special characters in CPIM are dotted, numbers and domain 
hidden): 
(...)

--boundary1
Content-Type: message/cpim
Content-Length: 296

From: <sip:+48xxxxxxxxx@xxxxxxxxxxxxxxxx>
To: <tel:+48xxxxxxxxx>
NS: rcse <urn:g5:rcse:im>
imdn.Message-ID: MsgxrVsdTTABA
DateTime: 2012-01-14T19:28:35.000Z
imdn.Disposition-Notification: positive-delivery, negative-delivery, display

Content-type: text/plain
Content-length: 5

cze....
--boundary1--

The actual Content-lenght is 7. All parent Content-lengths (SIP & CPIM) are 
also therefore incorrect.

Original issue reported on code.google.com by pkurp...@gmail.com on 14 Jan 2012 at 10:39

GoogleCodeExporter commented 9 years ago

Original comment by jmauffret@gmail.com on 24 Jan 2012 at 11:16

GoogleCodeExporter commented 9 years ago
in next release

Original comment by jmauffret@gmail.com on 7 Feb 2012 at 3:20