将wchar_t *类型转换为托管的UTF-8字符串

时间:2011-10-30 19:22:57

标签: string unicode c++-cli wchar-t

如何在C ++ / CLI中将wchar_t*类型转换为托管UTF-8字符串?

1 个答案:

答案 0 :(得分:2)

假设你的意思是System::String“托管的UTF-8字符串”(尽管托管字符串是UTF16),请使用

String ^systemstring = gcnew String(YoutrWCharString);

有关示例和详细信息,请参阅How to: Convert Between Various String Types on MSDN