Is wchar_t needed for unicode support?

前端 未结 8 1403
情书的邮戳
情书的邮戳 2020-12-01 03:49

Is the wchar_t type required for unicode support? If not then what\'s the point of this multibyte type? Why would you use wchar_t when you could accomplish the

相关标签:
8条回答
  • 2020-12-01 04:19

    wchar_t is not required. It's not even guaranteed to have a specific encoding. The point is to provide a data type that represents the wide characters native to your system, similar to char representing native characters. On Windows, for example, you can use wchar_t to access the wide character Win32 API functions.

    0 讨论(0)
  • 2020-12-01 04:22

    char is generally a single byte. (sizeof(char) must be equal to 1).

    wchar_t was added to the language specifically to suppose multibyte characters.

    0 讨论(0)
提交回复
热议问题