Convert ’ to an apostrophe
From an XML , the curly apostrophe is rendered as : ’, and displayed as ? (unknown)
because my server and Cf are in ISO--8859-1.
As this is an included file,
I cannot use the tags :
<cfprocessingdirective pageEncoding="UTF-8">
<cfcontent type="text/html; charset=UTF-8">
I only needs it for a small piece of text dipslayed. Not the whole page.
I searched for hours, I did not find any solution to convert the ’ to a single apostrophe.
I tried :
<cfset title=#replacenocase(title,'’',"'","all")#> does not do anything.
I tried :
<cfscript>
s="#title#";
chr_current="UTF-8";
chr_new="ISO-8859-1";
c=createobject("java", "java.lang.String").init(s);
convstring=createobject("java", "java.lang.String").init(c.getbytes(chr_current),chr_new).tostring();
title=convstring;
</cfscript> does not do anything.
I tried :
<cfset title=#replacenocase(title,"’","'","all")#> does not do anything. Because the char found is : ’
Thanks for any help.
More general question is :
How to convert a piece of text from UTF-8 to ISO--8859-1 ? not the whole page, because text coming from the DB is
stored as ISO--8859-1.
