Convert UTF-16/32 unicode NSString into UTF16/32Char

225 views Asked by At

I've got strings that store UTF-16 and UTF-32 unicode value :

NSMutableString *utf16String = [[NSMutableString alloc] init];
[utf16String setString: @"F000"]; //U+F000

NSMutableString *utf32String = [[NSMutableString alloc] init];
[utf32String setString: @"F0000"]; //U+F0000

I want to convert these strings into UTF16Char and UTF32Char in hexadecimal value to obtain the same result as :

UTF16Char utf16Char = 0xF000;
UTF32Char utf32Char = 0xF0000;

Thanks in advance for your help

0

There are 0 answers