Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
Wide string conversion with multibyte chars and locale
//Microsoft (R) C/C++ Optimizing Compiler Version 19.00.23506 for x64 #include <iostream> #include <Windows.h> int main() { wchar_t pLocale[256]; GetSystemDefaultLocaleName(pLocale, sizeof(pLocale)); std::wcout << L"Current locale: " << pLocale << std::endl; const wchar_t* ppInput[] = { L"測試", L"αβ", L"Środa" }; for(size_t i = 0; i < _countof(ppInput); ++i) { std::wcout << L"Original string: " << ppInput[i] << std::endl; char pOutput[256] = { '\0' }; size_t bytesConverted = 0; size_t ret = wcstombs_s(&bytesConverted, pOutput, sizeof(pOutput), ppInput[i], sizeof(pOutput) - 1); std::cout << "\tret = " << ret << ", bytesConverted = " << bytesConverted << ", output = " << pOutput << std::endl; } }
run
|
edit
|
history
|
help
0
Matrix_1
Hello World
복소수 클래스 생성하기
Redeclare with auto
hex manip
Default constructor - none defined
primitive type copy constructor
MSVC_example_GetAllocLength
Attribute of qi parsers
hangman