The low half of ANSI codes [# 0 .. # 127] does not change after conversion to Unicode, so you should not worry about that. The high half [# 128 .. # 255] is harder. The compiler interprets strings
const s1:AnsiString = #200;
const s2:UnicodeString = #200;
depending on the directive {$ HIGHCHARUNICODE}
{$HIGHCHARUNICODE OFF}
const s1:AnsiString =
const s2:UnicodeString =
{$HIGHCHARUNICODE ON}
const s1:AnsiString =
const s2:UnicodeString =
# 200 - "And" on the Win1251 code page. The Unicode code for "AND" is $ 418.
Unicode # 200, on the other hand, has a È. Win1251 does not have a “È” character, and a Unicode → Win1251 conversion converts it to “E”, which is # 45 US dollars for all ANSI code pages.
With {$ HIGHCHARUNICODE OFF}, the compiler interprets the characters # 128 .. # 255 as ANSI characters depending on the system code page and, if necessary, converts them to Unicode code pages.
{$ HIGHCHARUNICODE ON} # 128.. # 255 Unicode , , ANSI .
Nick, Unicode Delphi:
var
Buf: array[0..32] of Char;
begin
FillChar(Buf, Length(Buf),
ShowMessage(Format('%d %d %d', [Ord(Buf[0]), Ord(Buf[0]), Ord(Buf[16])]));
end;
FillChar; FillChar (BTW Buf ) Unicode. FillChar FillBytes (# 9) .