/****************************************************************************** * This program computes a Unicode test page. * * Copyright © 2016 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); wcout << L"Basic Latin" << endl; for (int i = 0x20; i < 0x7F; ++i) { wcout << wchar_t(i); if (i % 32 == 31) { wcout << endl; } } wcout << endl; wcout << endl; wcout << L"Latin-1" << endl; for (int i = 0xA0; i <= 0xFF; ++i) { wcout << wchar_t(i); if (i % 32 == 31) { wcout << endl; } } wcout << endl; wcout << L"Latin Extended-A" << endl; for (int i = 0x100; i <= 0x17F; ++i) { wcout << wchar_t(i); if (i % 32 == 31) { wcout << endl; } } wcout << endl; wcout << L"Latin Extended-B" << endl; for (int i = 0x180; i <= 0x24F; ++i) { wcout << wchar_t(i); if (i % 32 == 31) { wcout << endl; } } wcout << endl; wcout << endl; wcout << L"Greek and Coptic" << endl; for (int i = 0x374; i <= 0x3FF; ++i) { wcout << wchar_t(i); if (i % 32 == 31) { wcout << endl; } } wcout << endl; wcout << L"Cyrillic" << endl; for (int i = 0x400; i <= 0x4FF; ++i) { wcout << wchar_t(i); if (i % 32 == 31) { wcout << endl; } } wcout << endl; wcout << L"Other" << endl; for (int i = 0x2070; i <= 0x26F0; ++i) { wcout << wchar_t(i); if (i % 32 == 31) { wcout << endl; } } return 0; }