Latest SVN Lazarus, FPC 2.4.2, Windows7 32_bit starter.
Task: converter from Latin to Cyrilic.
No special fonts are used (tried default, Arial...) nor charset (default, UNICODE)
Rather strange problem and possibly bug. Conversion tables are insert into .pas files as a constant in string array. Conversions goes correct until some special characters are used, e.g. "đ" to "ђ", or "š" to "ш". Thus comparison to find "đ" fails.
Assumed there is a difference in saved utf8 .pas, however assigning these character into edit.text or caption shows correct result. Assume also that string type have full utf8 is supported for windows.
This is very simple part of the code to demonstrate the problem:
procedure TForm1.Button5Click(Sender: TObject);
const
Cyr : array [1..4] of string = ('а','б','ђ','ш');
Lat : array [1..4] of string = ('a','b','đ','š');
var
i: integer;
s: string;
begin
s:='abđš';
for i:=1 to 4 do
begin
if s[i] = Lat[i] then
caption:=caption+ Cyr[i]
end;
end;
Caption have only "аб", correct result should be "абђш".
Direct assigning value into caption returns correct result:
caption:= 'абђш';
or
caption:= 'abđš';
Can anyone confirm?