为什么有些字符常量为1字节宽,有些则为2字节宽?

时间:2012-09-06 10:12:01

标签: delphi delphi-xe2

我以为我开始理解Unicode了,但这比我好:

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 

有人可以解释一下吗? Delphi XE2,默认Windows-1252代码页

由于 扬

1 个答案:

答案 0 :(得分:8)

有记录 - 请参阅$HIGHCHARUNICODE指令