Jump to content
Sign in to follow this  
Hrushikesh Shet

Delphi - Data is not encoded in given format

Recommended Posts

In my Delphi application (Embarcadero RAD Studio 10.0 Seattle), I am trying to convert an rvf file to HTML using TJvRichEdit and TJvRichEditToHtml components. The issue I am facing is that the HTML file appears in ANSI encoding format. I need to get it in UTF-8 format to display the proper content in html file.

I have tried the following ways to achieve the same:

 

  1. Tried to use the available properties of TJvRichEdit for converting ANSI to UTF-8.
  2. Tried to add the rtf file to TStrings and then used UTF8Encode to convert it.
  3. Tried to add data into TMemoryStream and then tried adding it to TJvRichEdit.
  4. Used TStreamReader to get the encoding format of the source file and then used TStreamWriter to convert it into UTF-8 encoding.
     

All the above ways convert the encoding format but the content remains in ANSI format.

I have also tried using TRichEdit, TcxRichEdit and TdxRichEditControl to find out if we can load data into html file. But the data gets loaded in ANSI encoding format itself.

 

Any help would be appreciated.

Edited by Hrushikesh Shet

Share this post


Link to post

FYI cross posted here (unicode - Delphi - Data is not encoded in given format - Stack Overflow) and with no code there either.

 

As a rule, I think cross-posting is fine on this site, but you should always note that you've done so to avoid people spending time giving you help when you already received it elsewhere. It's just a good courtesy to the people that you are asking for help.

 

But in any case, you should improve the post (in both places) by giving details of your code so that we have something concrete.

  • Like 1

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×