Created
December 2, 2021 19:40
-
-
Save alrnz/703f4139fd9fb2b29aae530f330d0e8a to your computer and use it in GitHub Desktop.
Replace decomposed saved chars in the db
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
Ersetzt alle "Decomposed" gespeicherten Umlaute (ü,ö,ä,Ö) in der Datenbank | |
Ersetzt alle kaputten Ligaturen (ffi) in der Datenbank | |
https://de.wikipedia.org/wiki/Umlaut#Unicode | |
*/ | |
UPDATE THE_TABLE | |
SET THE_FIELD = UNHEX( | |
REPLACE( | |
REPLACE( | |
REPLACE( | |
REPLACE( | |
REPLACE( | |
HEX(THE_FIELD) | |
, 'EFAC83', '666669') /* ffi => EFAC83 => 666669 */ | |
, '6FCC88', 'C3B6') /* ö => 6FCC88 => C3B6 */ | |
, '61CC88', 'C3A4') /* ä => 61CC88 => C3A4 */ | |
, '75CC88', 'C3BC') /* ü => 75CC88 => C3BC */ | |
, '4FCC88', 'C396') /* Ö => 4FCC88 => C396 */ | |
) WHERE HEX(THE_FIELD) LIKE '%CC88%' or HEX(THE_FIELD) LIKE '%EFAC83%'; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment