This project has moved and is read-only. For the latest updates, please go here.

Error with  in html

Jul 27, 2012 at 11:06 AM

Hello,

I am using the latest source code version of the great html to openxml component. When submitting a html string which contains following characters: "" I receive on wordDocument.Close() following error:

' ', hexadecimal value 0x01, is an invalid character.

At the moment I replace this character from my html string before calling the converter.

Any ideas how to convert this character to a valid word element?

Coordinator
Jul 27, 2012 at 2:52 PM

mmm interresting. After some googling, I found this post that talk about invalid character in Xml.
I will update soon the source code to include the changes.
For the moment, you can edit HttpUtility.cs at line 117:

if (IsLegalXmlChar(result)) output.Write((char) result);


and append the IsLegalXmlChar from the blog to the end of the HttpUtility.cs file.

Coordinator
Aug 3, 2012 at 10:39 AM

Fix in changeset #78474