An open API service indexing awesome lists of open source software.

https://github.com/tsnsoft/cppconsoleutf8win

Пример простейшей консольной программы на C++ с использованием boost для Visual Studio 2022
https://github.com/tsnsoft/cppconsoleutf8win

boost console cpp utf-8 visual-studio

Last synced: 11 months ago
JSON representation

Пример простейшей консольной программы на C++ с использованием boost для Visual Studio 2022

Awesome Lists containing this project

README

          

# CppConsoleUTF8win
Пример простейшей консольной программы на C++ с использованием boost для Visual Studio 2022

```
#pragma execution_character_set( "utf-8" ) // for MSVC

#include // for utf8_to_utf16
#include // for fstream
#include // for cout, cerr, cin, clog

using namespace boost::nowide; // for cout, cerr, cin, clog
using std::endl; // for endl

int main()
{
//system("chcp 65001");
std::locale::global(std::locale("En-us.UTF-8")); // for MSVC
cout << "Testing unicode -- English -- Ελληνικά -- Español -- Русский. aäbcdefghijklmnoöpqrsßtuüvwxyz\n";
std::string fio; // = "Иванов Иван Иванович";
cout << "Введите строку: ";
cin >> fio;
cout << "Вы ввели: " << fio << "\n";
cout << "Размер строки: " << fio.length() << endl;
for (int i = 0; i < fio.length(); ++i) {
cout << "[" << i << "]" << fio[i] << " (code: " << int(fio[i]) << ")" << endl;
}
return 0;
}
```

## Ссылки:

https://www.boost.org/

https://visualstudio.microsoft.com/ru/vs/community/