Run Code
|
API
|
Code Wall
|
Users
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
UTF-8 in C++11
#include <codecvt> #include <locale> #include <iostream> #include <iomanip> int main() { using namespace std; locale wcin_loc{wcin.getloc(), new codecvt_utf8<wchar_t>{}}; wcin.imbue(wcin_loc); locale wcout_loc{wcout.getloc(), new codecvt_utf8<wchar_t>{}}; wcout.imbue(wcout_loc); wcout << "Len Word" << endl; wcout << "=== ====" << endl; for (wstring str; wcin >> str; ) { wcout << setw(3) << str.length() << " " << str << endl; } }
run
|
edit
|
history
|
help
0
Please
log in
to post a comment.
even number
Graphs Iteration1 Undirected.
mddd
ternary test c++14
mine
my override
marquee text in C++
PrintAddress
Pascals Triangle
CS1428 SI Tuesday
Please log in to post a comment.