Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <string>
- #include <cstring>
- #include <iostream>
- #include <windows.h>
- int main(void)
- {
- // use utf8 literal
- std::string test = u8"1°à€3§4ç5@の,は,でした,象形字 ;";
- // set code page to utf8
- SetConsoleOutputCP(CP_UTF8);
- // Enable buffering to prevent VS from chopping up UTF-8 byte sequences
- setvbuf(stdout, nullptr, _IOFBF, 1000);
- // printing std::string to std::cout, not std::wstring to std::wcout
- std::cout << test << std::endl;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement