Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
Unicode_write2file
//Microsoft (R) C/C++ Optimizing Compiler Version 19.00.23506 for x86 #include <locale> #include <codecvt> #include <iostream> #include <fstream> int main() { const std::locale utf8_locale = std::locale(std::locale(), new std::codecvt_utf8<wchar_t>()); std::wofstream wfout; wfout.imbue(utf8_locale); wfout.open(L"Stats.txt"); wfout << "Line 1: " << L"Hello\x00B2!" << std::endl; wfout << "Line 2: " << L"O\x00B3 x\x2080 + x\x2081 + x\x2082" << std::endl; wfout << "Line 3: " << L"x\x2083\x208A\x2084" << std::endl; wfout << "Line 4: " << L"\x20AC Euro!" << std::endl; wfout << "Line 5: " << L"2\x2077\x207B\x2079" << std::endl; wfout.close(); }
run
|
edit
|
history
|
help
0
students grade
dharmesh
#18
make Derive final
Copy vs Reference
upper_bound With binary_function Visual Studio 2008 Bug?
error_check
Sorting algorithm comparison
C string literal
Wide string conversion with multibyte chars and locale