![MACROMEDIA COLFUSION MX 7 - INSTALLING AND USING COLDFUSION MX Reference Download Page 834](http://html1.mh-extra.com/html/macromedia/colfusion-mx-7-installing-and-using-coldfusion-mx/colfusion-mx-7-installing-and-using-coldfusion-mx_reference_687505834.webp)
834
Chapter 3: ColdFusion Functions
Usage
Use this function when the character encoding of the input to a form or the character encoding of
a URL is not in UTF-8 encoding. For example, Traditional Chinese characters are often in Big5
encoding. This function resets URL and Form variables, so you should call it before using these
variables (typically, in the Application.cfm page or Application.cfc file). Calling this function first
also avoids interpreting the characters of the variables incorrectly.
For more information on character encoding, see the following web pages:
•
www.w3.org/International/O-charset.html
provides general information on character
encoding and the web, and has several useful links.
•
www.iana.org/assignments/character-sets
is a complete list of character sets names used on the
Internet, maintained by the Internet Assigned Numbers Authority.
•
java.sun.com/j2se/1.4.1/docs/guide/intl/encoding.doc.html
lists the character encoding that
Java 1.4.1, and therefore the default ColdFusion configuration, can interpret. If you use a JVM
that does not conform to the Sun Java 2 Platform, Standard Edition, v 1.4.1, the supported
locales may differ. The list uses Java internal names, not the IANA character encoding names
that you normally use in the
SetEncoding
charset
parameter and other ColdFusion
attributes and parameters. Java automatically converts standard IANA names to its internal
names as needed.
Example
<!--- This example sends and interprets the contents of two fields as
big5 encoded text. Note that the form fields are received as URL variables
because the form uses the GET method. --->
<cfcontent type="text/html; charset=big5">
<form action='#cgi.script_name#' method='get'>
<input name='xxx' type='text'>
<input name='yyy' type='text'>
<input type="Submit" value="Submit">
</form>
<cfif IsDefined("URL.xxx")>
<cfscript>
SetEncoding("url", "big5");
WriteOutput("URL.XXX is " & URL.xxx & "<br>");
WriteOutput("URL.YYY is " & URL.yyy & "<br>");
theEncoding = GetEncoding("URL");
WriteOutput("The URL variables were decoded using '" &
theEncoding & "' encoding.");
</cfscript>
</cfif>
Summary of Contents for COLFUSION MX 7 - INSTALLING AND USING COLDFUSION MX
Page 1: ...COLDFUSION MX7 CFML Reference...
Page 20: ...20 Chapter 1 Reserved Words and Variables...
Page 50: ...50 Chapter 2 ColdFusion Tags cfelse br Searching cfif cfloop cfif...
Page 101: ...cfdefaultcase 101 cfdefaultcase cfswitch cfoutput Your grade is grade cfoutput...
Page 115: ...cfdocumentsection 115 cfdocumentsection cfoutput cfdocument...
Page 411: ...cftable 411 cftable body html...
Page 515: ...Chr 515 maxlength 5 p input type Submit name input type RESET cfform...
Page 605: ...GetEncoding 605 WriteOutput The encoding is theEncoding cfscript cfif...
Page 629: ...GetProfileString 629 tr td input type Submit name Submit value Submit td td td tr table form...
Page 655: ...IIf 655 cfoutput IIf Hour Now GTE 12 DE It is afternoon or evening DE It is morning cfoutput b...
Page 664: ...664 Chapter 3 ColdFusion Functions cfelse h3 Conversion error h3 cfif...
Page 687: ...IsStruct 687 cfoutput cfquery cfif cfoutput hr Employee Add Complete cfoutput cfcase cfswitch...
Page 751: ...LSDateFormat 751 hr noshade cfoutput cfloop...
Page 861: ...StructFind 861 cfquery cfif cfoutput hr Employee Add Complete cfoutput cfcase cfswitch...
Page 903: ...Val 903 value Is the beginning numeric name form...
Page 932: ...932 Chapter 3 ColdFusion Functions...
Page 944: ...944 Chapter 4 ColdFusion MX Flash Form Style Reference...
Page 962: ...962 Chapter 5 Application CFC Reference...
Page 1054: ...1054 Chapter 6 ColdFusion MX Event Gateway Reference...