What is the equivalent in Objective-C of .Net's System.Text.Encoding.Unicode
?
I have tried:
None of the above converted the text back correctly.
According to http://msdn.microsoft.com/de-de/library/system.text.encoding.unicode.aspx, System.Text.Encoding.Unicode
is the little-endian UTF-16 encoding. The equivalent NSString
encoding is NSUTF16LittleEndianStringEncoding
.
NSUTF16StringEncoding
is almost the same, but prepends a Unicode Byte-Order Marker (BOM) FF FE
to the data. (And strictly speaking, it is not documented that NSUTF16StringEncoding
uses little-endian, so the explicit NSUTF16LittleEndianStringEncoding
should be used anyway.)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With