Starting Coldfusion 8, I try to clear the text input before saving it to a database that will perceive things like the MS equivalent of the letters "" - and accented letters, and convert them.
I tried replacing, REReplace and various UDFs found on the Internet. Nobody seems to be working. In fact, I tried this:
<cfscript>
function cleanString(string) {
var newString = string;
newString = replace("'", "'", ALL);
return newString;
}
</cfscript>
The only quote that needs to be replaced above is a single quote in MS Word style. Coldfusion threw an error, the error region indicated invalid syntax, and the single quote in the error region was a square. If I change it to the form chr () and replace it with ', I will get a space. If I do chr () for an object, I get a space.
I am more than sure that I used to jump this obstacle, and I donβt know why now nothing works. Is there a new parameter in CF8 vs CF7 regarding character encoding that I am missing?
Kevin source
share