Link to home
Start Free TrialLog in
Avatar of yarek
yarekFlag for France

asked on

Tmemo HTML souce and french accents lost

I have a simple HTML that I got from Twebbrowser.

I have saved it as mot.txt


when I load it with Tstringlist.loadfromfile or with memo1.lines.loadfromfile
accents get lost:

À propos de Google->À propos

or
Actualités->Actualités


I need to to get the good accents

(I tried for hours with ANSI/WIDECHAR/UNICODE) translation: no way !
Avatar of yarek
yarek
Flag of France image

ASKER

PS. I can get load them successfully with TRicheditor, but what I need is to load without any VISUAL components
(I need Tstrings, Tstringlist, Twidestring)...
can You mail me mot.txt ?
Avatar of yarek

ASKER

As I've expected it's UTF-8.
Try something like this.

  memo1.Lines.LoadFromFile('mot2.txt');
  memo1.Lines.Text := utf8toansi(memo1.Lines.Text);
ASKER CERTIFIED SOLUTION
Avatar of mokule
mokule
Flag of Poland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
You can try also utf8decode