Wieder was gelernt

mysql_enable_utf8mb4 doesn't work

Tags: mysql perl utf-8
2021-12-07

DBI->connect(..., {mysql_enable_utf8 => 1}) converts MySQL varchar columns to Perl character strings (i.e. an ‘ß’ shows up as “\x{DF}”, a ‘€’ as “\x{20ac}”, etc.)

But DBI->connect(..., {mysql_enable_utf8mb4 => 1})converts to Windows-1252 first, so the ‘€’ shows up as “\x{80}”. This also happens if you combine both.