问题
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