I can’t seem to find a good built-in way to convert an NSString to wchar_t… any tips on how to do this? Anything Apple exposes on the NSString class is for c-strings (char*) or for unichars, but nothing for wchar*.
Share
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.
wchar_tis compiler specific. Assuming you wan the Win32wchar_t, then UTF16 little ending encoded will do it. For Unixwchar_tyou may need the NSUTF32 encoding family, with your platform of choice endianess.