开发者

How do I test if wide characters work in my app?

开发者 https://www.devze.com 2023-01-28 03:28 出处:网络
I tried this: std::wcout << L\"\\u20AC\" << L\"\\n\"; B开发者_开发问答ut it only prints the newline. Am I not doing it right?

I tried this:

std::wcout << L"\u20AC" << L"\n";

B开发者_开发问答ut it only prints the newline. Am I not doing it right?

I have a function that takes const wchar_t* and I tried passing L"\u20AC" to it and it crashes at the part where I do wctombs_s on it. I think it's getting a NULL instead of the widechar.


L"\u20AC" is not a character, it is a string of wide characters. If you want print a single wide character to the console, you should write std::wcout << '\u20AC' << L"\n"; But if you want to print a string of wide chars then std::wcout << L"\\u20AC"<< L"\n";

0

精彩评论

暂无评论...
验证码 换一张
取 消