简体   繁体   中英

Is UTF-16 text encoding for XML supported by iOS and Android

Hopefully this is a quick answer, needing only a link to a credible source.

Would anyone know where to find a list of XML text encoding formats that are supported by iOS (specifically NSXMLParser) and it's equivalent for Android?

Specifically, is UTF-16 supported?

Thanks in advance.

I can't find a source from Apple specifically stating that UTF-16 is supported, but the XML spec states that all XML parsers MUST accept both UTF-8 and UTF-16 encodings so I think it's safe to assume that NSXMLParser conforms to that. You can always just test it and see if it supports any given encoding.

For encodings that actually are unsupported, you can use NSString/CFString methods to convert them to supported encodings.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM