Coldfusion does not convert accented text or MS Word characters

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?

+5
source share
1 answer

There is a large script for demonization (yes, this technical term) text copied from the word MS and the like. It can be found in CFLib:
http://cflib.org/index.cfm?event=page.udfbyid&udfid=725

I used it several times and was happy with it out of the box (although I added some add-ons for certain applications).

+6
source

All Articles