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(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.
SELECT CONVERT_REPLACEUTF8(BINARY_STRING('These characters cannot be converted — \xa0\xa1'), 'b') -- These characters cannot be converted — bb
Was this page helpful?
Glad to hear it! Thank you for your feedback. Sorry to hear that. Thank you for your feedback.