Link to home
Create AccountLog in
Avatar of wdgolden
wdgolden

asked on

Coldfusion XML String Replace FFFD Unicode character

I keep getting an error when I try to export my MySQL database to XML file.

ERROR MESSAGE:
XML Parsing Error: not well-formed
Location: https://www.intelligencecareers.com/_cs/resumes/xml2011v1/2010.12.29.xml
Line Number 37, Column 6:2003 ¿ 2007
-----^

The error occurs where the text should read '2003 - 2007'

Have tried to filter out the FFFD unicode character with:

<cfset newxml = rereplace(#newxml#, "[\0xfffd]", "", "All")>
and
<cfset newxml = rereplace(#newxml#, "[\0x2013]", "", "All")>

My unicode editor shows the offending charactoer to be U+2013

My XML page is set to UTF-8 but this and other characters keep appearing.

How do I filter out these higher unicode characters, and specfically FFFD or U+2013?
ASKER CERTIFIED SOLUTION
Avatar of zc2
zc2
Flag of United States of America image

Link to home
membership
Create an account to see this answer
Signing up is free. No credit card required.
Create Account
Avatar of wdgolden
wdgolden

ASKER

This worked. Substituting the different encoding (Windows-1252) for UTF-8 worked without a hitch. A BIG thanks!
you're welcome