Skip to content

Latest commit

 

History

History
23 lines (17 loc) · 961 Bytes

convert_replaceutf8.md

File metadata and controls

23 lines (17 loc) · 961 Bytes
description
Converts a binary string to a UTF-8 value and replaces all characters that cannot be converted to UTF-8 with the specified replacement character.

CONVERT_REPLACEUTF8

Syntax

CONVERT_REPLACEUTF8(binary_value value_to_convert, replacement VARCHAR) → VARCHAR

  • binary_value: The binary string to convert to a string encoded in UTF8.
  • replacement: A single character to use as a substitute for each character in the binary string that cannot be converted to UTF8.

Examples

{% code title="CONVERT_REPLACEUTF8 example" %}

SELECT CONVERT_REPLACEUTF8(BINARY_STRING('These characters cannot be converted — \xa0\xa1'), 'b')
-- These characters cannot be converted — bb

{% endcode %}