Why isn't wchar_t widely used in code for Linux / related platforms?

前端 未结 4 1849
迷失自我
迷失自我 2020-12-30 04:22

This intrigues me, so I\'m going to ask - for what reason is wchar_t not used so widely on Linux/Linux-like systems as it is on Windows? Specifically, the Windo

4条回答
  •  一整个雨季
    2020-12-30 04:56

    wchar_t is not the same size on all platforms. On Windows it is a UTF-16 code unit that uses two bytes. On other platforms it typically uses 4 bytes (for UCS-4/UTF-32). It is therefore unlikely that these platforms would standardize on using wchar_t, since it would waste a lot of space.

提交回复
热议问题