/****************************************************************************** * Simple first program with Unicode strings. * * 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); wcout << L"!مرحبا أيها العالم" << endl; wcout << L"你好, 世界!" << endl; wcout << L"Hello, world!" << endl; wcout << L"Bonjour le monde!" << endl; wcout << L"Hallo welt!" << endl; wcout << L"Γειά σου Κόσμε!" << endl; wcout << L"!שלום העולם" << endl; wcout << L"नमस्ते दुनिया!" << endl; wcout << L"こんにちは世界!" << endl; wcout << L"안녕, 월드!" << endl; wcout << L"Привет, мир!" << endl; wcout << L"¡Hola mundo!" << endl; return 0; }