/****************************************************************************** * This program strips an input stream of all non-alpha characters. * * Copyright © 2017 Richard Lesh. All rights reserved. *****************************************************************************/ #include #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); int cp; while ((cp = getwchar()) != EOF) { if (iswalpha(cp)) { putwchar(cp); } } return 0; }