Sunday, May 12, 2013

NSString localizedNameOfStringEncoding example ios


localizedNameOfStringEncoding:

Returns a human-readable string giving the name of a given encoding.
+ (NSString *)localizedNameOfStringEncoding:(NSStringEncoding)encoding
Parameters
encoding
A string encoding.
Return Value[ NSString localizedNameOfStringEncoding example ]
A human-readable string giving the name of encoding in the current locale’s language.
[ NSString localizedNameOfStringEncoding example ]
const NSStringEncoding *enc = [NSString availableStringEncodings];
while (*enc != 0) {
    NSString *name = [NSString localizedNameOfStringEncoding:*enc];
    NSLog(@"%@ %d (0x%x)",name, *enc, *enc);
    enc++;
}