/****************************************************************************** * This program prints international "Hello, yourname!" * * Copyright © 2016 Richard Lesh. All rights reserved. *****************************************************************************/ #undef NDEBUG #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); // Arabic wcout << L"مرحبا ريتشارد!" << endl; // Chinese wcout << L"你好,理查德!" << endl; // English wcout << L"Hello, Richard!" << endl; // French wcout << L"Bonjour, Richard!" << endl; // German wcout << L"Hallo Richard!" << endl; // Greek wcout << L"Γεια σας, Ρίτσαρντ!" << endl; // Hebrew wcout << L"שלום, ריצ'רד!" << endl; // Italian wcout << L"Ciao, Richard!" << endl; // Japanese wcout << L"こんにちは、リチャード!" << endl; // Korean wcout << L"안녕, 리차드!" << endl; // Russian wcout << L"Привет, Ричард!" << endl; // Spanish wcout << L"¡Hola, Ricardo!" << endl; return 0; }