Page 1 of 1

Report.LogHTML and unprintable characters

Posted: Wed Jul 28, 2010 4:55 pm
by atom
Hiya

It seems that the method Report.LogHTML does not check the message is valid
We have a case whereby we capture some text off the screen, and log it
the captured text contains the ENQ character, and when logged corrupts the ranorex log file

Can you confirm if the Report class does any checks to ensure valid xml is always produced
or should I write my own checks before logging?

Thanks

Re: Report.LogHTML and unprintable characters

Posted: Thu Jul 29, 2010 8:59 am
by Support Team
Hi,
atom wrote:Can you confirm if the Report class does any checks to ensure valid xml is always produced
or should I write my own checks before logging?
The Report.LogHTML doesn't check if the xml file is valid. So the best way would be to write your own checks before logging, e.g. using the System.Web.HttpUtility.HtmlEncode method:
http://msdn.microsoft.com/en-us/library/73z22y6h.aspx

Regards,
Peter
Ranorex Team