General TRichView support forum. Please post your questions here
cjw
Posts: 6 Joined: Fri Feb 15, 2013 3:17 am
Post
by cjw » Fri Feb 15, 2013 3:30 am
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?
Sergey Tkachenko
Site Admin
Posts: 17557 Joined: Sat Aug 27, 2005 10:28 am
Contact:
Post
by Sergey Tkachenko » Fri Feb 15, 2013 6:01 am
Do you use rvhtmlview importer? If yes, does this document look correctly in THTMLViewer?
cjw
Posts: 6 Joined: Fri Feb 15, 2013 3:17 am
Post
by cjw » Fri Feb 15, 2013 6:12 am
Yes using rvhtmlviewimporter. Documents shows up fine in THTMLViewer.
cjw
Posts: 6 Joined: Fri Feb 15, 2013 3:17 am
Post
by cjw » Fri Feb 15, 2013 6:16 am
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;
cjw
Posts: 6 Joined: Fri Feb 15, 2013 3:17 am
Post
by cjw » Mon Feb 18, 2013 1:08 am
Delphi 6 with HTMLViewer 11.3.
cjw
Posts: 6 Joined: Fri Feb 15, 2013 3:17 am
Post
by cjw » Tue Feb 19, 2013 2:30 am
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: 17557 Joined: Sat Aug 27, 2005 10:28 am
Contact:
Post
by Sergey Tkachenko » Wed Feb 20, 2013 12:07 pm
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 » Fri Feb 22, 2013 1:28 am
Sent a project producing the problem to svt at trichview dot com.