User Guide
508 Chapter 3: ColdFusion Functions
CharsetDecode
Description
Converts a string to a binary representation.
Returns
A binary object that represents the string.
Category
Conversion functions, String functions
Function syntax
CharsetDecode(string, encoding)
See also
BinaryDecode
, BinaryEncode, CharsetEncode; “Determining the page encoding of server
output” in Chapter 17, “Developing Globalized Applications,” in ColdFusion MX Developer’s
Guide
History
ColdFusion MX 7: Added this function.
Parametersc
Usage
This function converts a string directly to a binary object. In releases of ColdFusion through
ColdFusion MX 6.1, you had to use the
ToBase64 function to convert the string to Base64 and
then use the
ToBinary function to convert strings to binary data.
Parameter Description
string A string containing data to encode in binary format.
encoding A string specifying encoding of the input data. Must be a character encoding name
recognized by the Java runtime. The following list includes commonly used values:
• utf-8
• iso-8859-1
• windows-1252
• us-ascii
• shift_jis
• iso-2022-jp
• euc-jp
• euc-kr
• big5
• euc-cn
• utf-16
For a complete list of character encoding names supported by Sun Java runtimes,
see http://java.sun.com/j2se/1.3/docs/guide/intl/encoding.doc.html and
http://java.sun.com/j2se/1.4/docs/guide/intl/encoding.doc.html.