I need to read an XML from socket which is having mixed content of arabic and english. my problem is that when I am converting the received bytes in UTF-8, I am gett开发者_如何学Cing the english content properly but arabic content is seems junk.
Any help is highly appreciated.
Regards, rohit
Alright expert,
I got the solution to my problem :)
The problem relies on the desktop server part.
Actually I was passing the Arabic String from my desktop Java application using DataOutputStream
with method writeUTF()
which is actually sending the the header containing the length of the data using writeShort()
implicitly. So on the iPhone part, when I was using
[[NSString alloc] initWithData:data
encoding:NSUTF8StringEncoding] ;
which is creating problem.
when I started to send data by write(byte[])
it worked!
精彩评论