Hi,
I just suddenly started having trouble with file encoding. Just not
sure what caused the issue maybe someone can point me in the right
direction.

For an AJAX based web site i return JSON formatted strings to the
clients using the cfcontent tag. However suddenly german umlauts (üäß
etc.) are being returned as ??. So there is some sort of encoding
issue. The code used to work with umlauts so I am not sure what has
changed. An insight into how cfcontent works would be great.

Here is what I have checked:
- The .cfm templates are saved in UTF-8 a BOM flag exists at the
beginning of the file.
- If I use a cfoutput the umlauts are shown correctly, when using
cfcontent ?? are shown.
- Tried setting a <cfheader name="Content-Type" value="text/
html:charset=utf-8">
- Specified a type attribute in the cfcontent tag. (type="text/
html:charset=utf-8").

I have build a test case added below which should show the issue. When
returning the content with cfoutput everyting is fine with cfcontent i
get the ??

Is this a bug or some setting i am not aware off. This used to work,
not sure what has changed.

Open Bluedragon V1.3

cheers

Marcel

scribble.cfm
===========================================================================
<cfset tmp = "Blümchen Fuß. äüö.">

<cfif CGI.REQUEST_METHOD EQ "GET">
                <!--- GET Request. --->
                <cfoutput><h3>Response from CFCONTENT:</h3></cfoutput>
                <cfhttp url="#CGI.SCRIPT_NAME#" method="post">
                        <cfhttpparam  type="formfield" name="content" 
value="true">
                </cfhttp>
                <cfoutput><hr>#cfhttp.FileContent#</cfoutput>


                <cfoutput><h3>Response from CFOUTPUT:</h3></cfoutput>
                <cfhttp url="#CGI.SCRIPT_NAME#" method="post">
                        <cfhttpparam  type="formfield" name="content" 
value="false">
                </cfhttp>
                <cfoutput><hr>#cfhttp.FileContent#</cfoutput>
<cfelse>
                <!--- POST Request. --->
                <cfif isDefined('content') AND content>
                        <cfcontent type="text/json" variable="#tmp#">
                <cfelse>
                        <cfoutput>#tmp#</cfoutput>
                </cfif>
</cfif>
===========================================================================

-- 
Open BlueDragon Public Mailing List
 http://www.openbluedragon.org/   http://twitter.com/OpenBlueDragon
 official manual: http://www.openbluedragon.org/manual/
 Ready2Run CFML http://www.openbluedragon.org/openbdjam/

 mailing list - http://groups.google.com/group/openbd?hl=en

Reply via email to