I am posting some text using network.request() method. It works perfect for alphanumerical characters(English letters…), But when I post Arabic or Russian (special characters), I get this error:
I/System.out(27394): ERROR: expected 385 bytes but received 393
The number of bytes depends on how big is the text, but the difference(ie: 393-385) is consistent and reflects the number of letters in the text.
It works fine when tested on iphone and mac simulator though the difference in bytes, but it fails in Android!
I’m still trying to figure out exactly why Android is objecting to the request but in the meantime specifying a binary body type seems to make it work for me:
This is fixed in Daily Build 2013.1147 (the Content-Length of POST requests was being miscalculated when there were multi-byte characters in a string).
I’m still trying to figure out exactly why Android is objecting to the request but in the meantime specifying a binary body type seems to make it work for me:
This is fixed in Daily Build 2013.1147 (the Content-Length of POST requests was being miscalculated when there were multi-byte characters in a string).
You can click the buttons at the bottom of the page where you can like, like but… or hate the docs. We do take your comments you make there and apply them when they make sense. I would say adding a gotcha about UTF-8 text needs to be sent in binary mode would be a good addition.
You can click the buttons at the bottom of the page where you can like, like but… or hate the docs. We do take your comments you make there and apply them when they make sense. I would say adding a gotcha about UTF-8 text needs to be sent in binary mode would be a good addition.