Is '\u0B95' a multicharacter literal?

后端 未结 4 1419
悲&欢浪女
悲&欢浪女 2021-01-11 19:23

In a previous answer I gave, I responded to the following warning being caused by the fact that \'\\u0B95\' requires three bytes and so is a multicharacter

4条回答
  •  日久生厌
    2021-01-11 19:34

    Because you have no character encoding prefix gcc (and any other conformant compiler) will see '\u0B95' and think 1) char type and 2) multicharacter because there is more than one char code in the string.

    • u'\u0B95' is a UTF16 character.
    • u'\u0B95\u0B97' is a multicharacter UTF16 character.
    • U'\ufacebeef' is a UTF32 character.

    etc.

提交回复
热议问题