Tag: cocos2d x

将Platform :: String转换为std :: string

我正在获取String^ ,它包含一些印度语言字符,来自C#WinCT组件中C#Component的回调,用于Windows Phone 8项目的Cocos2dx游戏。 每当我将它转换为std::string ,印地语和其他字符就会变成垃圾字符。 我无法找到为什么会这样。 这是一个示例代码,我刚刚在这里定义了Platform::String^但是考虑从C#Component传递给C++ WinRT Component组件 String^ str = L”विकास, વિકાસ, ਵਿਕਾਸ, Vikas”; std::wstring wsstr(str->Data()); std::string res(wsstr.begin(), wsstr.end());