Specifications

Codec
A codec (short-hand for "code-decode") specifies the text encoding used to represent a Unicode
string as a sequence of 8-bit bytes. Various codecs are in use throughout the industry.
The utility module refers to supported codecs through predefined names. To specify a codec in
a function argument, use one of the following strings:
Apple Roman
ISO 8859-1 to 10
ISO 8859-13 to 16
latin1
UTF-8
UTF-8BOM (see byte order marker below)
UTF-16
UTF-16BE
UTF-16LE
Windows-1250 to 1258
In addition the utility module supports the following special codecs (See Hex and Base64 below
for more information):
Hex (corresponds to xsd:hexBinary)
Base64 (corresponds to xsd:base64Binary and SOAP-ENC:base64)
toHex, toBase64
fromHex, fromBase64
Note:
If the codec argument is missing or null, the codec is set to UTF-8 on Mac and to the current ANSI
code page on Windows.
Conversion errors
When converting from a byte sequence to a text string, byte sequences that do not match the
requirements for the codec are replaced by the Unicode representation of a question mark (“?”).
When converting from a text string to a byte sequence, Unicode code points that cannot be
represented as a byte sequence using the codec are replaced by the ASCII representation of a
question mark (“?”).
Byte order marker (BOM): Input (from a byte sequence to a text string)
Regardless of the specified codec, the utility module automatically recognizes a UTF-16 BOM and
when found, the codec is automatically adjusted to the appropriate UTF-16 variant. For example,
if the codec argument is set to “UTF-8”, the utility module will correctly read UTF-8, UTF-16BE
and UTF-16LE.
Byte order marker (BOM): Output (from a text string to a byte sequence)
When the codec is set to one of the UTF-16 variants, the utility module always outputs an
appropriate 2-byte UTF-16 BOM at the beginning of the data.
409
Enfocus Switch 10