Why are some character constants 1 byte wide, and others 2 bytes wide?

社会主义新天地 提交于 2019-12-10 16:12:19

问题


I thought I was beginning to understand Unicode, but this beats me:

const
c1 = #1;   --> SizeOf() = 2
c2 = #33;  --> SizeOf() = 2
c3 = #127; --> SizeOf() = 2
c4 = #128; --> SizeOf() = 1
c5 = #160; --> SizeOf() = 1 
c6 = #161; --> SizeOf() = 1 
c7 = #255; --> SizeOf() = 1 

Can anyone explain? Delphi XE2, Default Windows-1252 codepage

Thanks Jan


回答1:


That is documented - see $HIGHCHARUNICODE directive



来源:https://stackoverflow.com/questions/12297755/why-are-some-character-constants-1-byte-wide-and-others-2-bytes-wide

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