I hava a NSData
object which represents a NSString
object. I use -[NSString initWithData:encoding:]
to get the string. Now the problem is how do I know the correct encoding type?
Thanks.
Edited:
I test and find:
the supposing the NSData
is encoding with A, and I try to use encoding B to create the NSString
. Sometimes the string will be nil, but string can be not nil which is a messy code. So I can't get the correct string by testing the each encoding type.