Garbled text after using TRVHtmlImporter for Japanese html
Posted: Thu Feb 09, 2006 3:01 pm
Hi there,
I'm using TRVHtmlImporter to import html email from storage, this works well for single bype charsets, but when I try it with some Japanese email it results in garbaled text.
Below is a snippet of my code.
Please tell me what I am doing wrong.
Thanks in advance.
I'm using TRVHtmlImporter to import html email from storage, this works well for single bype charsets, but when I try it with some Japanese email it results in garbaled text.
Below is a snippet of my code.
Code: Select all
if docType='HTML' then begin
Editor.Clear;
if XActiveLang = 7 then begin // Language = Japanese
Importer.ClearDocument := False;
Importer.DefaultFontName := 'MS PGothic';
Importer.DefaultCFontName := 'MS PGothic';
Importer.RichView.Style.DefCodePage := 932;
Editor.RTFReadProperties.UnicodeMode := rvruOnlyUnicode;
Editor.ClearUndo;
ConvertRVToUnicode(Editor.RVData);
for x := 0 to Importer.RichView.Style.TextStyles.Count -1 do begin
Importer.RichView.Style.TextStyles[x].Unicode := True;
Importer.RichView.Style.TextStyles[x].FontName := 'MS PGothic';
Importer.RichView.Style.TextStyles[x].Charset := SHIFTJIS_CHARSET;
end;
ConvertRVToUnicode(Editor.RVData);
Importer.LoadHtml(strList1.Text);
end else
Importer.LoadHtml(strList1.Text);
Editor.Format;
end else if docType='RTF' then begin
Thanks in advance.