Skip to content

Instantly share code, notes, and snippets.

Brad Beattie bradbeattie

Block or report user

Report or block bradbeattie

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
danielholmstrom / fix_double_encoded_utf8.example.sql
Created Oct 5, 2011
Fix double encoded UTF-8 in mysql with an SQL-query.
View fix_double_encoded_utf8.example.sql
-- Example of how to fix double encoded UTF-8 in mysql with a single mysql query.
-- This example assumes that the data has been inserted with NAMES=latin1.
-- XXX: Do not rely on this to work without testing it. XXX
-- XXX: If this is run on a column with a UNIQUE index and the COLLATE is
-- case-insensitive this might fail. The reason for this is that double-encoded
-- upper and lower case chars are considered different but when encoded correctly
-- they will be considered the same.
You can’t perform that action at this time.