## Syntax ```mermaid %%{init: { 'theme': 'base', 'flowchart': { 'padding': '7', 'nodeSpacing': '20', 'rankSpacing': '20' }, 'themeVariables': { 'fontSize': '11px', 'fontFamily': 'Arial' } }}%% flowchart LR Start((START)) --> BLOB_TO_TEXT[BLOB_TO_TEXT]:::quoted BLOB_TO_TEXT --> End((END)) ``` ## Purpose The `BLOB_TO_TEXT` SQL function maps a binary object (`blob`) into a sequence of characters in a specific character set, and then into the Invantive UniversalSQL Unicode representation. See also [[ASCII_TO_BLOB]]. Parameters: - Input: a binary representation of a text in some encoding. - Encoding: optional encoding as described in [[Character Set Encoding]]. Defaults to `UTF8`. Returns: text in Unicode. ## Examples `BLOB_TO_TEXT` maps the binary representation of an ASCII character text back to Unicode text: ```sql select blob_to_text(ASCII_TO_BLOB('12345678')) -------- 12345678 ``` `BLOB_TO_TEXT` maps the binary data retrieved using `read_file` to a Unicode interpreting the data as IBM860 character set: ```sql select blob_to_text(file_contents, 'IBM860') from read_file@os('c:\temp\readme-ibm860-set.txt') -------- Text ```