Sunday, September 29, 2013

Xcode how to turn char wchar

Known to turn char type wchar code is as follows:
TZWchar * m_ptext;
TZChar strCommand [max_path] = {0};
NSString * str0 = [[NSString alloc] initWithBytes: m_ptext length: (wcslen (m_ptext) * sizeof (TZWchar)) encoding: NSUTF8LittleEndianStringEncoding];
if (str0)
{
strcpy (strcommand, [str0 UTF8String]);
}
These realized in C + + WideCharToMultiByte (CP_ACP, NULL, m_ptext, wcslen (m_ptext), strCommand, max_path, NULL, NULL);
Will XCode from Char to wchar how to write.
Reply:
Are the same, you change the encoding: NSUTF8LittleEndianStringEncoding Hangleba

No comments:

Post a Comment