Whatever message this page gives is out now! Go check it out!
CharsetDecode(string, encoding)Parameter | Description |
string | A string containing data to encode in binary format. |
encoding | A string that specifies encoding of the input data. Must be a character encoding name recognized by the Java runtime. The following list includes commonly used values:
|
<h3>Character Encoding Conversion Example</h3>
<!--- Do the conversions. --->
<cfscript>
myString="Hello ColdFusion"
charEncoding='utf-8'
chardecode=CharsetDecode(myString, charEncoding);
charencode=CharsetEncode(chardecode, charEncoding);
</cfscript>
<!--- Display the input values and results. --->
<cfoutput>
<h3>Parameter Settings</h3>
<p><b>The string:</b>
#myString#</p>
<p><b>The character encoding:</b> #charEncoding#</p>
<h3>Results of the operations:</h3>
<p><b>Dump of the string converted to a binary object by CharsetDecode:
</b>
<cfdump var="#chardecode#"></p>
<p><b>The binary object converted back to a string by CharsetEncode:
</b>
#charencode#</p>
</cfoutput>