User Guide
CharsetEncode 511
CharsetEncode
Description
Uses the specified encoding to convert binary data to a string.
Returns
A string representation of the binary object.
Category
Conversion functions, String functions
Function syntax
CharsetEncode(binaryobject, encoding)
See also
BinaryDecode
, BinaryEncode, CharsetDecode; “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
Macromedia recommends that you use this function, and not the ToString function, to convert
binary data to strings in all new applications.
Parameter Description
binaryobject A variable containing binary data to decode into text.
encoding The character encoding that was used to encode the string into binary format. It
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.