Is 0xFFFF a valid Unicode character? [duplicate]

依然范特西╮ 提交于 2021-02-05 06:38:08

问题


I just wonder whether 0xFFFF is a valid Unicode character.

When I using the following code:

CStringW strTempW;
CString strTemp1;
INT_PTR nLen;

strTempW.Format(L"%c", 0xFFFF);
nLen = strTempW.GetLength();

strTemp1 += strTempW;
nLen = strTemp1.GetLength();

After executing the first codeline strTempW.Format(L”%c”, 0xFFFF), I will get strTempW of length 1, but cannot see it first character in Visual Studio watch window.

After executing the codeline strTemp1 += strTempW, I will get strTemp1 of length 0.

That is confusing to me. Is 0xFFFF taken as a valid Unicode code point or not?


回答1:


Go to the Unicode web site unicode.org/charts and enter FFFF in the box. It will give you a PDF to download (UFFF0.pdf for this character code; different files for different codes).

You'll find that U+FFFF is not a valid Unicode character:

FFFF <not a character>

  • The value FFFF is guaranteed not to be a Unicode character at all



回答2:


As stated in this great answer it is not, it is a reserved non character.



来源:https://stackoverflow.com/questions/20735405/is-0xffff-a-valid-unicode-character

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!