1. Peter Moran
  2. PowerBuilder
  3. Tuesday, 9 February 2021 15:41 PM UTC

Hi,

I'm using the Webbrowser control to display some XML - it gets nicely formatted by the control.

However, it gives an error if the XML contains any extended characters (contains German/French).

"This page contains the following errors:
error on line 2 at column 2095: Encoding error
Below is a rendering of the page up to the first error."

Is there some setting that I need to adjust on the control?

Thanks,

Peter

Attachments (1)
Accepted Answer
Mark Goldsmith Accepted Answer Pending Moderation
  1. Tuesday, 9 February 2021 16:52 PM UTC
  2. PowerBuilder
  3. # Permalink

Hi Peter,

I suspect it's due to the encoding of the XML file in question...in this case possibly being ANSI encoded This is not the fault of the webbrowser control per se. If you open the same file in any web browser it will likely do the same thing.

I don't believe there is anything you can do by way of changing properties of the control or calling a function on the control in order for it to show up properly.

A couple of options come to mind:

1) make sure the XML file is saved as UTF-8 encoded and if that's not possible then

2) At the beginning of the XML file you should see something like <?xml version="1.0"?>. Change it so it looks like the following: <?xml version="1.0" encoding="iso-8859-1"?>. It should then open up in the webbrowser control (and any web browser) just fine.  Hopefully you could make this change in advance, wherever the file is being created, but if not you could programmatically add it to the beginning of the file as well. 

HTH.

Regards,

Mark

Comment
There are no comments made yet.
Peter Moran Accepted Answer Pending Moderation
  1. Thursday, 11 March 2021 16:32 PM UTC
  2. PowerBuilder
  3. # 1

Hi,

Apologies for late reply - only getting back to this now.

Mark - adding that line solved the problem.

 

Thanks,

Peter

Comment
  1. Mark Goldsmith
  2. Thursday, 11 March 2021 16:37 PM UTC
Great to hear that worked Peter and thanks for the update...regards,

Mark
  1. Helpful
There are no comments made yet.
Kai Zhao @Appeon Accepted Answer Pending Moderation
  1. Wednesday, 10 February 2021 01:24 AM UTC
  2. PowerBuilder
  3. # 2

Hi Peter,

I agree with Mark’s analysis. Please try referring to it to solve the issue.

If there is still the issue, please provide a sample XML file for us to do more study, thanks.

Regards,
ZhaoKai

Comment
There are no comments made yet.
  • Page :
  • 1


There are no replies made for this question yet.
However, you are not allowed to reply to this question.