Apparently, the org.apache.commons.lang.StringEscapeUtils java class'
escapeXml method escapes this (and other) characters properly. So
something like:
<cfset escapers = CreateObject('java',
'org.apache.commons.lang.StringEscapeUtils')>
<cfset cleanedDescription = escapers.escapeXml(description)>
When I first tested this out I found that the
org.apache.commons.lang.StringEscapeUtils class could not be found so
I had to install the org.apache.commons.lang package which can be
found here:
http://commons.apache.org/downloads/download_lang.cgi
Note: I've not been able to test this with a string that produces the
error you are having.
HTH
Dominic
2008/7/4 Mike Kear <[EMAIL PROTECTED]>:
> I'm getting this error in a XML job i'm doing and I can't see where
> this illegal character is creeping in. The offending text field is
> one called 'description', - i know that becuase if i remove it from
> the XML I get valid XML.
>
> Unicode 0x19 is called End of Medium and is a control character.
>
> So i have used trim() on the data going into the description element, and also
> XMLFormat(). I would have thought that XMLFormat() would have fixed
> it, but it hasn't. I can't see where this character is creeping in,
> becuase it's a control character.
>
> I've also tried setting the page encoding to UTF-8 to see if that
> makes any difference but it doesn't.
>
> I've googled for quite a while now, and there are lots of people who
> see this problem - it's on forums everywhere, but no one seems to give
> an answer that works.
>
> Has anyone here come across this problem and solved it? ( The problem
> seems to be common to PHP and .Net applications too, but none of them
> have posted an answer that i have found. ) If you got round it, what
> did you do?
>
> --
> Cheers
> Mike Kear
> Windsor, NSW, Australia
> Adobe Certified Advanced ColdFusion Developer
> AFP Webworks
> http://afpwebworks.com
> ColdFusion, PHP, ASP, ASP.NET hosting from AUD$15/month
>
>
>
> --
> Cheers
> Mike Kear
> Windsor, NSW, Australia
> Adobe Certified Advanced ColdFusion Developer
> AFP Webworks
> http://afpwebworks.com
> ColdFusion, PHP, ASP, ASP.NET hosting from AUD$15/month
>
>
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to
date
Get the Free Trial
http://ad.doubleclick.net/clk;203748912;27390454;j
Archive:
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:308584
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4