I want to know the text file encoding in objective-c. Can you explain me how to know that?
You can use stringWithContentsOfFile:usedEncoding:error:
, which returns, in addition to the new string, the encoding that was used.
I should note that this is a heuristic process by nature -- it's not always possible to determine the character encoding of a file.
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