rvhtmlviewimporter & html entities

General TRichView support forum. Please post your questions here
Post Reply
cjw
Posts: 6
Joined: Fri Feb 15, 2013 3:17 am

rvhtmlviewimporter & html entities

Post by cjw »

I'm using rvhtmlviewimporter to import html to richviewedit. However the imported html with entities such as   show up either as weird characters or '?'.

Imported html:

Code: Select all

<html>
<head>
<title></title>
<link REL="stylesheet" TYPE="text/css" HREF="demo.css"> 
</head>
<body CLASS="indent">
<p CLASS="heading"><a NAME="a">Test</a></p>
<p>test &nbsp; import&html&nbsp;&nbsp; 
<br>
&nbsp;</p>
</body>
</html>
Output in richviewedit:
Image

How do I get them to show up properly?
Sergey Tkachenko
Site Admin
Posts: 17571
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Post by Sergey Tkachenko »

Do you use rvhtmlviewimporter? If yes, does this document look correctly in THTMLViewer?
cjw
Posts: 6
Joined: Fri Feb 15, 2013 3:17 am

Post by cjw »

Yes using rvhtmlviewimporter. Documents shows up fine in THTMLViewer.
cjw
Posts: 6
Joined: Fri Feb 15, 2013 3:17 am

Post by cjw »

This is the code where I'm importing the html to a richviewedit.

Code: Select all

ss := TStringStream.Create(html);
htmlViewer.LoadFromStream(ss);
rvHtmlViewImporter.ImportHtmlViewer(htmlViewer, rv);
NormalizeRichView(rv.RVData);
rv.Format;
Sergey Tkachenko
Site Admin
Posts: 17571
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Post by Sergey Tkachenko »

Which version of Delphi? Version of HTMLViewer?
cjw
Posts: 6
Joined: Fri Feb 15, 2013 3:17 am

Post by cjw »

Delphi 6 with HTMLViewer 11.3.
cjw
Posts: 6
Joined: Fri Feb 15, 2013 3:17 am

Post by cjw »

Problem solved by adding following code before loading html

Code: Select all

rv.Clear;
rv.Style.TextStyles[0].Unicode := true;
Thanks for the time.
Sergey Tkachenko
Site Admin
Posts: 17571
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Post by Sergey Tkachenko »

I cannot reproduce this problem even if the first text style is not Unicode.
Can you send me a simple project reproducing this problem?
cjw
Posts: 6
Joined: Fri Feb 15, 2013 3:17 am

Post by cjw »

Sent a project producing the problem to svt at trichview dot com.
Post Reply