Recent

Author Topic: Estou tento problemas com letras acentudas  (Read 2722 times)

aacs

  • New member
  • *
  • Posts: 7
Estou tento problemas com letras acentudas
« on: February 17, 2021, 01:18:13 pm »
Desculpe se estiver sendo repetitivo é porque pode ser algum bug que gostaria de compartilhar com vocês,  estou tendo problema e não consigo atribuir valores a nenhuma letra acentuda, se for letras sem acentos funciona normalmente, coloquei apenas uma letra 'ã 'aqui na função  pra não ficar grande o código, alguém pode me auxiliar?

Code: Pascal  [Select][+][-]
  1. function m(x:string): string;
  2. var
  3.   y: string;
  4.   w: integer;
  5. begin
  6.   Result := '';
  7.   for w := 1 to Length(x) do
  8.     begin
  9.       if (x[w] = 'ã')  
  10.      then  y := '6'
  11.         else
  12.           y := ' ';
  13.       Result := Result + y;
  14.     end;
  15. end;

[Edited to add code tags :-]
« Last Edit: February 17, 2021, 01:37:21 pm by trev »

dseligo

  • Hero Member
  • *****
  • Posts: 1222
Re: Estou tento problemas com letras acentudas
« Reply #1 on: February 17, 2021, 08:54:10 pm »
Code: Pascal  [Select][+][-]
  1. uses LazUTF8;
  2.  
  3.     function m(x:string): string;
  4.     var
  5.       y: string;
  6.       w: integer;
  7.     begin
  8.       Result := '';
  9.       for w := 1 to UTF8Length(x) do
  10.         begin
  11.           if (UTF8Copy(x,w,1) = 'ã')  
  12.          then  y := '6'
  13.             else
  14.               y := ' ';
  15.           Result := Result + y;
  16.         end;
  17.     end;

aacs

  • New member
  • *
  • Posts: 7
Re: Estou tento problemas com letras acentudas
« Reply #2 on: February 18, 2021, 07:49:42 am »
dseligo , muito obrigado!
Funcionou certinho.

Deus lhe pague

Att.

 

TinyPortal © 2005-2018