Page 1 of 1

TRVHtmlImporter with Unicode Characters

Posted: Wed Aug 26, 2020 8:19 am
by danielpricecds
Hi,

I am trying to load some html that conatains Unicode characters using the LoadHtml procedure on the TRVHtmlImporter component which seems, when the compilation is unicode enabled, to cast the input parameter to AnsiString which therefore translates the unicode characters to question marks. Any ideas on how I can display unicode characters using the HtmlImporter?

Thanks,
Daniel

Re: TRVHtmlImporter with Unicode Characters

Posted: Wed Aug 26, 2020 11:48 am
by Sergey Tkachenko
The parameter of LoadHTML is AnsiString. When you pass Unicode string there, it is converted to ANSI, and Unicode characters are converted to ?.
Use this code:

Code: Select all

  RvHtmlImporter1.LoadHtml(UTF8Encode(data));

Re: TRVHtmlImporter with Unicode Characters

Posted: Wed Aug 26, 2020 3:06 pm
by danielpricecds
Thanks Sergey, that worked!