Page 1 of 1
rvhtmlviewimporter & html entities
Posted: Fri Feb 15, 2013 3:30 am
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 import&html
<br>
</p>
</body>
</html>
Output in richviewedit:
How do I get them to show up properly?
Posted: Fri Feb 15, 2013 6:01 am
by Sergey Tkachenko
Do you use rvhtmlviewimporter? If yes, does this document look correctly in THTMLViewer?
Posted: Fri Feb 15, 2013 6:12 am
by cjw
Yes using rvhtmlviewimporter. Documents shows up fine in THTMLViewer.
Posted: Fri Feb 15, 2013 6:16 am
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;
Posted: Fri Feb 15, 2013 11:19 am
by Sergey Tkachenko
Which version of Delphi? Version of HTMLViewer?
Posted: Mon Feb 18, 2013 1:08 am
by cjw
Delphi 6 with HTMLViewer 11.3.
Posted: Tue Feb 19, 2013 2:30 am
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.
Posted: Wed Feb 20, 2013 12:07 pm
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?
Posted: Fri Feb 22, 2013 1:28 am
by cjw
Sent a project producing the problem to svt at trichview dot com.