[Lazarus] Case error with cirilyc

Rigel Rigel rigel at gbg.bg
Thu Sep 17 21:46:57 CEST 2009


 It works with lat symbol on the right but if on the right of CASE is cyrillic symbol in Memo2.text shows '?' instead correct symbol.

procedure TForm1.Button1Click(Sender: TObject);
  var
stInp: String;
stOut: String;
i: integer;
begin
stOut := '';
stInp := UTF8Decode(Memo1.Lines.Text); // convert the string

for i := 1 to length(stInp) do
case stInp[i] of
'а': stOut := stOut + 'а'; //Cir --> in Memo2 shows '?'
'б': stOut := stOut + 'б'; // --> in Memo2 shows '?'
'a': stOut := stOut + 'a'; //Lat --> ok
'b': stOut := stOut + 'b'; // --> ok
End;

stOut := stOut + stInp[i];
// stOut := UTF8Decode(stOut);
// Memo2.Lines.Text := UTF8Decode(stOut);
Memo2.Lines.Text := stOut;
end;                                 



 >-------- Оригинално писмо --------
 >От:  dmitry boyarintsev 
 >Относно: Re: [Lazarus] Case error with cirilyc
 >До: Lazarus mailing list 
 >Изпратено на: Четвъртък, 2009, Септември 17 16:09:03 EEST

 >As Vincent mentioned earlier, LCL works with UTF8 Encoded strings.
 >
 >You need to convert Memo.Text to ansi string first:...

 >




More information about the Lazarus mailing list