All, thanks for the help with this issue. Using CDATA didn't work as apparently CF does parse whatever's within the CDATA block and was still choking on the bad character. I ultimately implemented the rereplace suggested by S. Isaac, and after some tweaking it worked. Here's the final code:
<cfset itemNameClean = rereplace(itemName,"[#chr(1)#-#chr(8)#-#chr(11)#-#chr(12)#-#chr(14)#-#chr(28)#-#chr(29)#-#chr(31)#-#chr(38)#]","","ALL")> <title>#itemNameClean#</title> I had to add in chr(28) and chr(29) into the rereplace as those are the equivalents to Unicode 0x1c and 0x1d which were the bad characters that the user had entered somehow. Also added chr(38) which is the '&' character, also a baddie. -- Josh ----- Original Message ----- From: "Jochem van Dieten" <[EMAIL PROTECTED]> To: "CF-Talk" <[email protected]> Sent: Monday, April 10, 2006 2:31 AM Subject: Re: Bad character crashing cfxml > Josh Nathanson wrote: >> >> --------------- >> An error occured while Parsing an XML document. >> An invalid XML character (Unicode: 0x1c) was found in the element content >> of >> the document. >> ------------------ >> >> The values in question are text strings entered by users and could >> contain >> tabs, carriage returns, line feeds etc. I've tried stripping those out >> using Replace but no luck, and tried XmlFormat(variable) with no luck. >> >> When I look up the unicode character 0x1c00, it says it's unassigned. > > Your user is probably entering ISO-8859-x and you are trying to > process it as Unicode. Make sure your charsets match along the > whole process. > > Jochem > > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~| Message: http://www.houseoffusion.com/lists.cfm/link=i:4:237359 Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4 Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4 Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4 Donations & Support: http://www.houseoffusion.com/tiny.cfm/54

