# C＃與C ++/CLI中的Unicode字符串文字

C#:
char z = '\u201D';
int i = (int)z;

C++/CLI:
wchar_t z = '\u201D';
int i = (int)z;


EDIT: Size of wchar_t can not be of issue here, because:

C++/CLI:
wchar_t z = (wchar_t)8221;
int i = (int)z;


Here too, i becomes 8221, so wchar_t is indeed up to the game of holding a 16-bit integer on my system. Ekeforshus

## 最佳答案

wchar_t z = L'\x201D';