Text.ToBinary is a Power Query M function that encodes a text value into a binary value using a specified encoding. The function returns the binary value resulting from the encoding process.
Compatible with: Power BI Service Power BI Desktop Excel Microsoft 365
Syntax
Text.ToBinary(
text as nullable text,
optional encoding as nullable number,
optional includeByteOrderMark as nullable logical,
) as nullable binary
Argument | Attribute | Description |
---|---|---|
text | ||
encoding | optional | Uses the TextEncoding.Type to specify the text’s binary encoding format. By default, if not provided, the argument uses TextEncoding.Utf8 (UTF8 binary form). Other available options are: – TextEncoding.Unicode: use the UTF16 little-endian binary form. – TextEncoding.Utf16: use the UTF16 little-endian binary form. – TextEncoding.BigEndianUnicode: use the UTF16 big endian binary form. – TextEncoding.Windows: use the Windows binary form. – TextEncoding.Ascii: use the ASCII binary form. |
includeByteOrderMark | optional |