loading html to non-empty rve - possible?

General TRichView support forum. Please post your questions here
Sergey Tkachenko
Site Admin
Posts: 14078
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Re: loading html to non-empty rve - possible?

Post by Sergey Tkachenko » Thu Nov 30, 2017 4:48 pm

Your original code saves HTML in UTF-8 encoding. But HTMLViewer does not understand that it is UTF-8, and loads it in another encoding, so text becomes corrupted.
When we change encoding, HTML is saved in UTF-16 encoding. HTMLViewer detects it, and loads correctly.

When you call HTMLViewer.LoadFromString, pictures are loaded exactly like as if you call methods for loading from a file or string.
But you should specify the correct base path in the parameter of ImportHtmlViewer/AppendHtmlViewer.

If you still want to use files, create them in a temporal directory, not in the application directory, because it can be read-only.

Post Reply