Loading TOC...

MarkLogic 12 EA 1 Product Documentation
xdmp.binaryDecode

xdmp.binaryDecode(
   encoded as Node,
   encoding-name as String
) as String

Summary

Converts an encoded byte sequence, passed in as a binary node, from the specified encoding to a unicode string.

Parameters
encoded A binary node containing the encoded stream.
encoding-name Specifies the encoding to use when decoding the document. Supported values include UTF-8 and ISO-8859-1. The string specified for the encoding option will be matched to a registered encoding name using the Unicode Charset Alias Matching rules (http://www.unicode.org/reports/tr22/#Charset_Alias_Matching).

Example

xdmp.binaryDecode(
   cts.doc("binary_doc_encoded_as_ShiftJIS.dat").root,
          "sjis");
=> contents of document after decoding, in unicode characters

Stack Overflow iconStack Overflow: Get the most useful answers to questions from the MarkLogic community, or ask your own question.