/****************************************************************************** * This program simply copies an input stream to the console line by line. * * Copyright © 2020 Richard Lesh. All rights reserved. *****************************************************************************/ #include #include #include #include std::locale utf8loc(std::locale(), new std::codecvt_utf8); using namespace std; int main(int argc, char **argv) { setlocale(LC_ALL, "en_US.UTF-8"); wcout.imbue(utf8loc); wcin.imbue(utf8loc); wstring line; while (getline(wcin, line)) { wcout << line << endl; } return 0; }