Skip to content

Instantly share code, notes, and snippets.

View fredshonorio's full-sized avatar
💭
🌲

Frederico Honório fredshonorio

💭
🌲
View GitHub Profile
CREATE FUNCTION fixUtf8Chars(str TEXT) RETURNS TEXT
BEGIN
SET str = REPLACE(str, CHAR(0xC383C2A9), CHAR(0xC3A9)); -- é
SET str = REPLACE(str, CHAR(0xC383C289), CHAR(0xC389)); -- É
SET str = REPLACE(str, CHAR(0xC383C2A8), CHAR(0xC3A8)); -- è
SET str = REPLACE(str, CHAR(0xC383C288), CHAR(0xC388)); -- È
SET str = REPLACE(str, CHAR(0xC383C2AA), CHAR(0xC3AA)); -- ê
SET str = REPLACE(str, CHAR(0xC383C28A), CHAR(0xC38A)); -- Ê
SET str = REPLACE(str, CHAR(0xC384C296), CHAR(0xC496)); -- Ė
SET str = REPLACE(str, CHAR(0xC384C297), CHAR(0xC497)); -- ė