I’m creating an app based on a API server. The server is currently in UTF-8 encoding.
Rather than write a line of code every time the API is accessed to re-encode text, I thought I may as well just set the server API to have the same text encoding as the app.
Only problem is I can’t find out the default encoding!
Where would I find this information, and can I change the default encoding on the app?
Cheers!
There is no default encoding.
NSStringcan have various encodings internally.I know that on Mac OS X, ASCII, UTF-8 and UTF-16 w/ host byte order are always among possible internal representations, iOS shouldn’t be different, though I’m not totally sure. I think it’s safe to assume that
stringWithUTF8String:will not cause any extra re-encoding.