Skip navigation.
Home

Replace Latin Swedish with Unicode in PhpMyAdmin

When establishing a website database (e.g., Drupal, Wordpress etc) with PhpMyAdmin (e.g., through CPanel) one may be surprised to discover that the default character collation order is in latin1_swedish_ci. For most "plain text" ASCII-style posts this isn't a problem. It becomes a problem however when an article is supposed to display characters which require a different character set. A personal discovery of this nature was with Esperanto diacritical characters. Characters which latin1_swedish_ci cannot display will be replaced with "?", one per character.

Now surprisingly this actually isn't a bug. In numerous collations characters with diacriticals are considered the same. The character set latin1_swedish_ci does distinguish between these such characters and therefore sorts and compares them correctly, most of the time for most Latin languages without the overhead that comes with Unicode.

If accuracy however is primary importance, the utf8_unicode_ci character set is the best choice, even more so that the more common utf8_general_ci. The former includes expansion mappings, such as expansions and contractions (e.g., the German "ß" is equal to "ss", or the Hebrew Niqqud symbols).

If one has an existing database with the well-intentioned latin1_swedish_ci character set, the simplist method to repair is to export the database, use a real text editor to replace the latin1_swedish_ci. For a new database in PhPMyAdmin will this setting will be found as part of the "General Settings MySQL connection collation".