Character Sets and Collations

This commit is contained in:
Alexander M. Turek
2003-07-23 19:08:11 +00:00
parent fcba0c459a
commit 70652a5352
95 changed files with 2201 additions and 92 deletions

109
server_collations.php3 Normal file
View File

@@ -0,0 +1,109 @@
<?php
/* $Id$ */
// vim: expandtab sw=4 ts=4 sts=4:
/**
* Does the common work
*/
require('./server_common.inc.php3');
/**
* Displays the links
*/
require('./server_links.inc.php3');
/**
* Displays the sub-page heading
*/
echo '<h2>' . "\n"
. ' ' . $strCharsetsAndCollations . "\n"
. '</h2>' . "\n";
/**
* Checks the MySQL version
*/
if (PMA_MYSQL_INT_VERSION < 40100) {
// TODO: Some nice Message :-)
include('./footer.inc.php3');
exit;
}
/**
* Includes the required charset library
*/
require('./libraries/mysql_charsets.lib.php3');
/**
* Outputs the result
*/
echo '<table border="0">' . "\n"
. ' <tr>' . "\n"
. ' <td valign="top">' . "\n"
. ' <table border="0">' . "\n"
. ' <tr>' . "\n"
. ' <th>' . "\n"
. ' ' . $strCollation . "\n"
. ' </th>' . "\n"
. ' <th>' . "\n"
. ' ' . $strDescription . "\n"
. ' </th>' . "\n"
. ' </tr>' . "\n";
reset($mysql_charsets);
reset($mysql_collations);
$i = 0;
$table_row_count = count($mysql_charsets) + $mysql_collations_count;
while (list(, $current_charset) = each($mysql_charsets)) {
if ($i > $table_row_count / 2) {
$i = 0;
echo ' </table>' . "\n"
. ' </td>' . "\n"
. ' <td valign="top">' . "\n"
. ' <table border="0">' . "\n"
. ' <tr>' . "\n"
. ' <th>' . "\n"
. ' ' . $strCollation . "\n"
. ' </th>' . "\n"
. ' <th>' . "\n"
. ' ' . $strDescription . "\n"
. ' </th>' . "\n"
. ' </tr>' . "\n";
}
$i++;
echo ' <tr>' . "\n"
. ' <td colspan="2" bgcolor="' . $cfg['ThBgcolor'] . '" align="right">' . "\n"
. ' &nbsp;<b>' . htmlspecialchars($current_charset) . '</b>' . "\n"
. ' (<i>' . htmlspecialchars($mysql_charsets_descriptions[$current_charset]) . '</i>)&nbsp;' . "\n"
. ' </td>' . "\n"
. ' </tr>' . "\n";
$useBgcolorOne = TRUE;
reset($mysql_collations[$current_charset]);
while (list(, $current_collation) = each($mysql_collations[$current_charset])) {
$i++;
echo ' <tr>' . "\n"
. ' <td bgcolor="' . ($mysql_default_collations[$current_charset] == $current_collation ? $cfg['BrowseMarkerColor'] : ($useBgcolorOne ? $cfg['BgcolorOne'] : $cfg['BgcolorTwo'])) . '">' . "\n"
. ' &nbsp;' . htmlspecialchars($current_collation) . '&nbsp;' . "\n"
. ' </td>' . "\n"
. ' <td bgcolor="' . ($useBgcolorOne ? $cfg['BgcolorOne'] : $cfg['BgcolorTwo']) . '">' . "\n"
. ' &nbsp;' . PMA_getCollationDescr($current_collation) . '&nbsp;' . "\n"
. ' </td>' . "\n"
. ' </tr>' . "\n";
$useBgcolorOne = !$useBgcolorOne;
}
}
unset($table_row_count);
echo ' </table>' . "\n"
. ' </td>' . "\n"
. ' </tr>' . "\n"
. '</table>' . "\n";
require('./footer.inc.php3');
?>