[Lazarus] Problems with accented characters

Silvio Clecio silvioprog at gmail.com
Mon Mar 8 03:53:28 CET 2010


Hello Marco, no problems friend :)

I'm trying with TUTF8Scanner + OnKeyPress, and TUTF8Scanner +
OnUTF8KeyPress, but not works. :(

Another test that fails:

procedure TForm1.Edit1UTF8KeyPress(Sender: TObject; var UTF8Key: TUTF8Char);
begin
  UTF8Key := 'Ç';
end;

Appear the caracters of the current typing in Edit, and not 'Ç'. :(

Marco Alvarado escreveu:
>> You have some example to replace the text in real time using this package?
> 
> Sorry, I don't have an example like that, but the example listed on
> the page seems simple enough:
> 
>  s := TUTF8Scanner.Create(Memo1.text);
>  s.FindChars := 'öäü';
>  repeat
>    case s.FindIndex(s.Next) of
>  {ö} 0: s.Replace('oe');
>  {ä} 1: s.Replace('ae');
>  {ü} 2: s.Replace('ue');
>    end;
>  until s.Done;
>  Memo1.Text := s.UTF8String;
>  s.free;
> 
> Hope it helps!
> -Marco

-- 
[]'s

Silvio Clécio
--
programmer ObjectPascal - Blog: http://blog.silvioprog.com.br
programmer ObjectPascal - Site: http://www.silvioprog.com.br
programmer ObjectPascal - Twitter: http://twitter.com/silvioprog
--
grupo Lazarus-BR no Google - http://groups.google.com/group/lazarus-br/
--
Mensagem assinada com PGP Public Key, Ver.: GnuPG v1.4.9 (GNU/Linux)




More information about the Lazarus mailing list