java - Porting NSString to NSData to Android -
we're porting 1 of projects objective-c java.
byte data coming server encoded string, , we're converting byte array.
[objective-c]:
nsstring * imagestring = @"abcde......"; //quite long string nsdata * imagedata = [imagestring datausingencoding:nsunicodestringencoding]; constant byte * imagebytes = [imagedata bytes]; now, i'm trying same on android
[java]:
string imagestring = "abcde......"; //quite long string byte [] imagebytes = imagestring.getdata("utf-16"); however, if compare imagebytes arrays first , second snippets, different. presume has utf-16 encoding i'm using in java case (there's no such option 'unicode', guess).
is there work around this?
Comments
Post a Comment