?
Solved

Tmemo HTML souce and french accents lost

Posted on 2006-04-24
8
Medium Priority
?
315 Views
Last Modified: 2012-05-05
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 !
0
Comment
Question by:yarek
  • 4
  • 2
6 Comments
 

Author Comment

by:yarek
ID: 16529965
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)...
0
 
LVL 17

Expert Comment

by:mokule
ID: 16530387
can You mail me mot.txt ?
0
 

Author Comment

by:yarek
ID: 16530585
0
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 
LVL 17

Expert Comment

by:mokule
ID: 16530705
As I've expected it's UTF-8.
Try something like this.

  memo1.Lines.LoadFromFile('mot2.txt');
  memo1.Lines.Text := utf8toansi(memo1.Lines.Text);
0
 
LVL 17

Accepted Solution

by:
mokule earned 2000 total points
ID: 16530940
or better

var
  s: utf8string;
  fs: TFileStream;
begin
  fs := TFileStream.Create('mot2.txt',fmOpenRead);
  SetLength(s,fs.Size);
  fs.Read(Pointer(s)^,fs.Size);
  fs.Free;
  memo1.Lines.Text := utf8toansi(s);
0
 
LVL 17

Expert Comment

by:mokule
ID: 16530945
You can try also utf8decode
0

Featured Post

New feature and membership benefit!

New feature! Upgrade and increase expert visibility of your issues with Priority Questions.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In this tutorial I will show you how to use the Windows Speech API in Delphi. I will only cover basic functions such as text to speech and controlling the speed of the speech. SAPI Installation First you need to install the SAPI type library, th…
Introduction Raise your hands if you were as upset with FireMonkey as I was when I discovered that there was no TListview.  I use TListView in almost all of my applications I've written, and I was not going to compromise by resorting to TStringGrid…
This video shows how to quickly and easily deploy an email signature for all users in Office 365 and prevent it from being added to replies and forwards. (the resulting signature is applied on the server level in Exchange Online) The email signat…
Loops Section Overview
Suggested Courses

862 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question