Skip to content

Instantly share code, notes, and snippets.

@ynroot
Created August 16, 2019 15:14
Show Gist options
  • Select an option

  • Save ynroot/0e1448c7448e8a9264e349b6a890949e to your computer and use it in GitHub Desktop.

Select an option

Save ynroot/0e1448c7448e8a9264e349b6a890949e to your computer and use it in GitHub Desktop.
convert encoding on a table
UPDATE
contas
SET morada =
IF(CONVERT(CAST(CONVERT(morada USING latin1) AS BINARY) USING utf8) IS NULL, morada,
CONVERT(CAST(CONVERT(morada USING latin1) AS BINARY) USING utf8))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment