3 // vim: expandtab sw=4 ts=4 sts=4:
5 if (PMA_MYSQL_INT_VERSION
>= 40100){
7 $res = PMA_mysql_query('SHOW CHARACTER SET;', $userlink)
8 or PMA_mysqlDie(PMA_mysql_error($userlink), 'SHOW CHARACTER SET;');
10 $mysql_charsets = array();
11 while ($row = PMA_mysql_fetch_array($res, MYSQL_ASSOC
)) {
12 $mysql_charsets[] = $row['Charset'];
13 $mysql_charsets_maxlen[$row['Charset']] = $row['Maxlen'];
14 $mysql_charsets_descriptions[$row['Charset']] = $row['Description'];
16 @mysql_free_result
($res);
19 $res = PMA_mysql_query('SHOW COLLATION;', $userlink)
20 or PMA_mysqlDie(PMA_mysql_error($userlink), 'SHOW COLLATION;');
22 sort($mysql_charsets, SORT_STRING
);
24 $mysql_collations = array_flip($mysql_charsets);
25 $mysql_default_collations = array();;
26 while ($row = PMA_mysql_fetch_array($res, MYSQL_ASSOC
)) {
27 if (!is_array($mysql_collations[$row['Charset']])) {
28 $mysql_collations[$row['Charset']] = array($row['Collation']);
30 $mysql_collations[$row['Charset']][] = $row['Collation'];
32 if ((isset($row['D']) && $row['D'] == 'Y') ||
(isset($row['Default']) && $row['Default'] == 'Yes')) {
33 $mysql_default_collations[$row['Charset']] = $row['Collation'];
37 $mysql_collations_count = 0;
38 foreach($mysql_collations AS $key => $value) {
39 $mysql_collations_count +
= count($mysql_collations[$key]);
40 sort($mysql_collations[$key], SORT_STRING
);
41 reset($mysql_collations[$key]);
44 @mysql_free_result
($res);
47 function PMA_getCollationDescr($collation) {
48 if ($collation == 'binary') {
49 return $GLOBALS['strBinary'];
51 $parts = explode('_', $collation);
52 if (count($parts) == 1) {
53 $parts[1] = 'general';
54 } elseif ($parts[1] == 'ci' ||
$parts[1] == 'cs') {
55 $parts[2] = $parts[1];
56 $parts[1] = 'general';
61 $descr = $GLOBALS['strBulgarian'];
64 $descr = $GLOBALS['strCaseInsensitive'];
67 $descr = $GLOBALS['strCaseSensitive'];
70 $descr = $GLOBALS['strCroatian'];
73 $descr = $GLOBALS['strCzech'];
76 $descr = $GLOBALS['strDanish'];
79 $descr = $GLOBALS['strEnglish'];
82 $descr = $GLOBALS['strEstonian'];
85 $descr = $GLOBALS['strGerman'] . ' (' . $GLOBALS['strDictionary'] . ')';
88 $descr = $GLOBALS['strGerman'] . ' (' . $GLOBALS['strPhoneBook'] . ')';
91 $descr = $GLOBALS['strHungarian'];
94 $descr = $GLOBALS['strLithuanian'];
97 $descr = $GLOBALS['strSwedish'];
100 $descr = $GLOBALS['strTurkish'];
103 $descr = $GLOBALS['strUkrainian'];
112 $descr = $GLOBALS['strUnicode'] . ' (' . $GLOBALS['strMultilingual'] . ')';
114 // West European charsets
121 $descr = $GLOBALS['strWestEuropean'] . ' (' . $GLOBALS['strMultilingual'] . ')';
123 // Central European charsets
128 $descr = $GLOBALS['strCentralEuropean'] . ' (' . $GLOBALS['strMultilingual'] . ')';
133 $descr = $GLOBALS['strRussian'];
135 // Simplified Chinese charsets
138 $descr = $GLOBALS['strSimplifiedChinese'];
143 $descr = $GLOBALS['strJapanese'];
148 $descr = $GLOBALS['strBaltic'] . ' (' . $GLOBALS['strMultilingual'] . ')';
153 $descr = $GLOBALS['strArmenian'];
156 $descr = $GLOBALS['strTraditionalChinese'];
159 $descr = $GLOBALS['strCyrillic'] . ' (' . $GLOBALS['strMultilingual'] . ')';
162 $descr = $GLOBALS['strArabic'];
165 $descr = $GLOBALS['strKorean'];
168 $descr = $GLOBALS['strHebrew'];
171 $descr = $GLOBALS['strGreek'];
174 $descr = $GLOBALS['strUkrainian'];
177 $descr = $GLOBALS['strTurkish'];
180 $descr = $GLOBALS['strSwedish'];
183 $descr = $GLOBALS['strThai'];
186 $descr = $GLOBALS['strUnknown'];
189 if (!empty($is_bin)) {
190 $descr .= ', ' . $GLOBALS['strBinary'];
195 if (!empty($parts[2])) {
196 if ($parts[2] == 'ci') {
197 $descr .= ', ' . $GLOBALS['strCaseInsensitive'];
198 } elseif ($parts[2] == 'cs') {
199 $descr .= ', ' . $GLOBALS['strCaseSensitive'];