does (w)ifstream support different encodings

前端 未结 3 1642
粉色の甜心
粉色の甜心 2020-11-30 08:18

When I read a text file to a wide character string (std::wstring) using an wifstream, does the stream implementation support different encodings - i.e. can it be used to rea

3条回答
  •  感动是毒
    2020-11-30 08:48

    The design of wide character string and wide character stream pre-dates UTF-8, UTF-16 and Unicode. If you want to get technical, the standard string and the standard stream don't necessarily operate on ASCII (it's just that basically all computers out there use ASCII; you could potentially have an EBCDIC machine).

    Raymond Chen once wrote a series illustrating how to work with different wide character stream/string types.

提交回复
热议问题