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
- Host: GitHub
- URL: https://github.com/tsnsoft/cppconsoleutf8win
- Owner: tsnsoft
- License: mit
- Created: 2023-11-19T17:14:53.000Z (over 2 years ago)
- Default Branch: master
- Last Pushed: 2023-11-19T17:14:57.000Z (over 2 years ago)
- Last Synced: 2025-03-11T02:49:47.948Z (over 1 year ago)
- Topics: boost, console, cpp, utf-8, visual-studio
- Language: C++
- Homepage:
- Size: 6.84 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
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/