I’m trying to use
NSString *iosString = [[NSString alloc] initWithFormat:@"%ls = %ls" arguments:argListSave];
The problem is that initWithFormat does not support %ls, and argListSave contain wchar_t*, how can I get around this limitation?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Edit: it seems that the two character types are of different size. You may thus want to implement an strcpy-like conversion function like this:
Edit 2: seems this is still not good. As @Jonathan Grinspan pointed out, you have to consider UTF32 code points as well and use
with NSUTF32LittleEndianStringEncoding on Intel macs and NSUTF32BigEndianStringEncoding on PowerPC Macs (length being thr string length in bytes, not characters).