In Java I can get all the available encodings with this code:
SortedMap<String, Charset> availableCharsets = Charset.availableCharsets();
Vector allEncodes = new Vector();
for (Map.Entry<String, Charset> entry : availableCharsets.entrySet()) {
allEncodes.add(entry.getKey());
}
Then, I can read any file with any encode I want:
Reader in = new InputStreamReader(new FileInputStream(aPath), allEncodes.get(0) );
So, is there any idea how to implement this in Objective-C
const NSStringEncoding* encodingArray = [NSString availableStringEncodings];
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