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*.
相关问题
- how to split a list into a given number of sub-lis
- Generate string from integer with arbitrary base i
- Converting a string array to a byte array
- Xcode debugger displays incorrect values for varia
- Is there a way to report errors in Apple documenta
相关文章
- 现在使用swift开发ios应用好还是swift?
- Visual Studio Code, MAC OS X, OmniSharp server is
- JSP String formatting Truncate
- xcode 4 garbage collection removed?
- IntelliJ IDEA can't open projects or add SDK o
- Selecting only the first few characters in a strin
- Automator: How do I use the Choose from List actio
- ImportError: No module named twisted.persisted.sty
wchar_t
is compiler specific. Assuming you wan the Win32wchar_t
, then UTF16 little ending encoded will do it. For Unixwchar_t
you may need the NSUTF32 encoding family, with your platform of choice endianess.Following code worked for me: (not sure if this will be applicable for wchar_t as well)