Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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

like image 758
Jan Doggen Avatar asked Feb 20 '23 06:02

Jan Doggen


1 Answers

That is documented - see $HIGHCHARUNICODE directive

like image 86
kludg Avatar answered Mar 22 '23 23:03

kludg