I need a code, to convert @"043b" to @"л"
Here is what I tried
// get a hex string (@"0x043b")
NSString *hexString = [@"0x" stringByAppendingString:@"043b"];
// scan an unsined int from it (1083 as expected)
NSScanner* pScanner = [NSScanner scannerWithString:hexString];
unsigned int iValue;
[pScanner scanHexInt: &iValue];
// get a unichar from it (';')
NSNumber *number = [NSNumber numberWithUnsignedInt:iValue];
unichar character = [number unsignedCharValue];
// get a string (@";")
NSString *result = [NSString stringWithFormat:@"%C", character];
but I get @";" instead of @"л"
I also tried
// get a char (';')
char character = [number charValue];
// get a string (@";")
NSString * result = [NSString stringWithFormat:@"%c", character];
Please, help!