Added test to check WideChar const to UTF8String const conversion

This commit is contained in:
Sergey Larin 2022-01-28 13:10:48 +03:00 committed by Michael Van Canneyt
parent de58691e75
commit 62c24b3756

View File

@ -0,0 +1,23 @@
program tutf8charconst;
{$mode objfpc}{$H+}
const
FULLWIDTH_RIGHT_PARENTHESIS: UTF8String = #$FF09;
var
UFFFF: UTF8String;
begin
if not((Length(FULLWIDTH_RIGHT_PARENTHESIS) = 3) and
(Ord(FULLWIDTH_RIGHT_PARENTHESIS[1]) = $EF) and
(Ord(FULLWIDTH_RIGHT_PARENTHESIS[2]) = $BC) and
(Ord(FULLWIDTH_RIGHT_PARENTHESIS[3]) = $89)) then
Halt(1);
UFFFF := #65535;
if not((Length(UFFFF) = 3) and
(Ord(UFFFF[1]) = $EF) and
(Ord(UFFFF[2]) = $BF) and
(Ord(UFFFF[3]) = $BF)) then
Halt(2);
end.