<?xml version="1.0" encoding="UTF-8"?><api:function-page xml:base="/apidoc/8.0/xdmp.binaryDecode.xml" generated="2015-10-07T16:36:00.016766-07:00" mode="javascript" xmlns:api="http://marklogic.com/rundmc/api"><api:function-name>xdmp.binaryDecode</api:function-name><api:suggest>xdmp.binarydecode</api:suggest><api:suggest>xdmp</api:suggest><api:suggest>binarydecode</api:suggest><api:function-link mode="xquery" fullname="xdmp:binary-decode">/apidoc/8.0/xdmp:binary-decode.xml</api:function-link><api:function mode="javascript" name="binaryDecode" type="builtin" lib="xdmp" category="Extension" subcategory="Extension" hidden="false" bucket="MarkLogic Built-In Functions" prefix="xdmp" namespace="http://marklogic.com/xdmp" fullname="xdmp.binaryDecode"><api:summary>
  Converts an encoded byte sequence, passed in as a binary node, from the
  specified encoding to a unicode string.
</api:summary><api:params><api:param name="encoded" type="node()"><api:param-description>
     A binary node containing the encoded stream.
  </api:param-description><api:param-name>encoded</api:param-name><api:param-type>Node</api:param-type></api:param><api:param name="encoding-name" type="xs:string"><api:param-description>
    Specifies the encoding to use when decoding the document.
    Supported values include <code xmlns="http://www.w3.org/1999/xhtml">UTF-8</code> and <code xmlns="http://www.w3.org/1999/xhtml">ISO-8859-1</code>.
    The string specifed for the <code xmlns="http://www.w3.org/1999/xhtml">encoding</code> option will be matched
    to a registered encoding name using the Unicode Charset Alias Matching rules
    (<a href="http://www.unicode.org/reports/tr22/#Charset_Alias_Matching" xmlns="http://www.w3.org/1999/xhtml">http://www.unicode.org/reports/tr22/#Charset_Alias_Matching</a>).
  </api:param-description><api:param-name>encoding-name</api:param-name><api:param-type>String</api:param-type></api:param></api:params><api:return>String</api:return><api:example class="javascript"><pre xml:space="preserve" xmlns="http://www.w3.org/1999/xhtml">
xdmp.binaryDecode(
   cts.doc("binary_doc_encoded_as_ShiftJIS.dat").root,
          "sjis");
=&gt; contents of document after decoding, in unicode characters
</pre></api:example></api:function></api:function-page>