1

I have read a lot of posts (almost all of it 4-5 years old) in that manner, and that way I learned that the things with UTF-8 are a little vague for Windows OS. But here is my question anyway. What is the "en_US.UTF-8" equivalent for Windows 10. This is a linux wide chars cin, cout imbuing locale command. Basically I want to input Cyrillic from console, output Cyrillic on console, read and write Cyrillic from and to files. The "en_US.UTF-8" is pretty handy in Linux, but its duplicate for Windows eludes me.

If you need more specifications, go ask me. :)

J.B.
  • 11
  • 1
  • Windows is not a UTF-8 based OS, it is UTF-16 based. Use wide APIs (`std::wcin`, `std::wcout`, `std::wfstream`, etc) instead of narrow APIs. You can imbue file streams with a locale based on a UTF-8 codecvt – Remy Lebeau Aug 11 '17 at 07:17
  • UTF-8 is a *byte* encoding. Each code-point uses one or more *bytes* (i.e. `char`). It can be converted into UTF-32 which *can* fit in a `wchar_t` on systems where `sizeof(wchar_t) >= 4`, but Windows is not such a system (on Windows `sizeof(wchar_t) == 2` and uses UTF-16). – Some programmer dude Aug 11 '17 at 07:17
  • Possible duplicate of https://stackoverflow.com/questions/166503/utf-8-in-windows – Galik Aug 11 '17 at 07:23
  • Possible duplicate of https://stackoverflow.com/questions/4324542/what-is-the-windows-equivalent-for-en-us-utf-8-locale – Galik Aug 11 '17 at 07:26

0 Answers0