+ if (!$lang)
+ $lang = 'utf8_'.substr($_SESSION['language']->code, 0, 2);
+
+ $db_collation = array(
+ 'utf8_is' => 'utf8_icelandic_ci',
+ 'utf8_lv' => 'utf8_latvian_ci',
+ 'utf8_ro' => 'utf8_romanian_ci',
+ 'utf8_sl' => 'utf8_slovenian_ci',
+ 'utf8_pl' => 'utf8_polish_ci',
+ 'utf8_et' => 'utf8_estonian_ci',
+ 'utf8_es' => 'utf8_spanish_ci', // or 'spanish2',
+ 'utf8_sw' => 'utf8_swedish_ci',
+ 'utf8_tr' => 'utf8_turkish_ci',
+ 'utf8_cs' => 'utf8_czech_ci',
+ 'utf8_da' => 'utf8_danish_ci',
+ 'utf8_lt' => 'utf8_lithuanian_ci',
+ 'utf8_sk' => 'utf8_slovak_ci',
+ 'utf8_sp' => 'utf8_spanish2_ci',
+ 'utf8_fa' => 'utf8_persian_ci',
+ 'utf8_hu' => 'utf8_hungarian_ci',
+ 'utf8_fr' => 'utf8_roman_ci',
+ 'utf8_it' => 'utf8_roman_ci',
+ );
+
+ return isset($db_collation[$lang]) ? $db_collation[$lang] : 'utf8_unicode_ci';