You are using Delphi 2007. That's before the beginning of Unicode era in Delphi Programming!
Although it is very tiresome to make Unicode work in early versions of Delphi, it is quite possible to attain a satisfactory result in some controls, especially the THtmlView component.
I post some code example from one of my programs:
//code to toggle source or WYSIWYG views
var
htmEd: IHTMLDocument2;
begin
htmEd := HtmlEdit.Document as IHtmlDocument2;
if ToggleTabSet.TabIndex = 0 then
begin
HtmlEditContainer.PageIndex := 0; // Tab sheet index
htmEd.body.innerHTML := Memo1.Lines.Text; // TTntMemo
pnlEditorState.Caption := 'Design View';
end
else
if ToggleTabSet.TabIndex = 1 then
begin
HtmlEditContainer.PageIndex := 1;
Memo1.Lines.Text := HtmEd.body.innerHTML;
pnlEditorState.Caption := 'Source View';
end;
Reading the above code you can see that I'm using a TTntMemo component to which the html file is loaded first. I'm then loading the 'Text' of the memo to HtmlView's 'body.innerHTML' property.
htmEd.body.innerHTML := Memo1.Lines.Text;
Note:
- TntWare's 'Memo1.Lines.Text;' is WideString type.
- 'IHTMLDocument2' comes from TEmbeddedWB. See reasons for why TEmbeddedWB is good?
That is what worked for me in early days. I have switched to Delphi 2009, and things are much easier now (just setting suitable TEncoding while loading files)!