removed deprecated PMA_convert_display_charset()

This commit is contained in:
Sebastian Mendel
2007-10-02 14:37:33 +00:00
parent 640becedc4
commit 43bd2d44bd
4 changed files with 4 additions and 79 deletions

View File

@@ -126,7 +126,7 @@ while ($i < $tbl_result_cnt) {
if ($tbl_names[$tbl] == ' selected="selected"') {
$fld[$k++] = PMA_backquote($tbl) . '.*';
while ($j < $fld_results_cnt) {
$fld[$k] = PMA_convert_display_charset($fld_results[$j]['Field']);
$fld[$k] = $fld_results[$j]['Field'];
$fld[$k] = PMA_backquote($tbl) . '.' . PMA_backquote($fld[$k]);
// increase the width if necessary

View File

@@ -131,77 +131,6 @@ if ($PMA_recoding_engine == PMA_CHARSET_ICONV_AIX) {
require_once './libraries/iconv_wrapper.lib.php';
}
/**
* Converts encoding according to current settings.
*
* @param mixed what to convert (string or array of strings or object returned by mysql_fetch_field)
*
* @return string converted string or array of strings
*
* @global array the configuration array
* @global boolean whether recoding is allowed or not
* @global string the current charset
* @global array the charset to convert to
*
* @access public
*
* @author nijel
*/
function PMA_convert_display_charset($what) {
global $cfg, $allow_recoding, $charset, $convcharset;
if (!(isset($cfg['AllowAnywhereRecoding']) && $cfg['AllowAnywhereRecoding'] && $allow_recoding)
|| $convcharset == $charset // rabus: if input and output charset are the same, we don't have to do anything...
// this constant is not defined before the login:
|| (defined('PMA_MYSQL_INT_VERSION') && PMA_MYSQL_INT_VERSION >= 40100)) { // lem9: even if AllowAnywhereRecoding is TRUE, do not recode for MySQL >= 4.1.x since MySQL does the job
return $what;
} elseif (is_array($what)) {
$result = array();
foreach ($what AS $key => $val) {
if (is_string($val) || is_array($val)) {
if (is_string($key)) {
$result[PMA_convert_display_charset($key)] = PMA_convert_display_charset($val);
} else {
$result[$key] = PMA_convert_display_charset($val);
}
} else {
$result[$key] = $val;
}
} // end while
return $result;
} elseif (is_string($what)) {
switch ($GLOBALS['PMA_recoding_engine']) {
case PMA_CHARSET_RECODE:
return recode_string($convcharset . '..' . $charset, $what);
case PMA_CHARSET_ICONV:
return iconv($convcharset, $charset . $cfg['IconvExtraParams'], $what);
case PMA_CHARSET_ICONV_AIX:
return PMA_aix_iconv_wrapper($convcharset, $charset . $cfg['IconvExtraParams'], $what);
case PMA_CHARSET_LIBICONV:
return libiconv($convcharset, $charset . $GLOBALS['cfg']['IconvExtraParams'], $what);
default:
return $what;
}
} elseif (is_object($what)) {
// isn't it object returned from mysql_fetch_field ?
if (@is_string($what->name)) {
$what->name = PMA_convert_display_charset($what->name);
}
if (@is_string($what->table)) {
$what->table = PMA_convert_display_charset($what->table);
}
if (@is_string($what->Database)) {
$what->Database = PMA_convert_display_charset($what->Database);
}
return $what;
} else {
// when we don't know what it is we don't touch it...
return $what;
}
} // end of the "PMA_convert_display_charset()" function
/**
* Converts encoding of text according to current settings.
*

View File

@@ -234,7 +234,6 @@ function PMA_DBI_get_client_info()
/**
* returns last error message or false if no errors occured
*
* @uses PMA_convert_display_charset()
* @uses PMA_DBI_convert_message()
* @uses $GLOBALS['errno']
* @uses $GLOBALS['userlink']
@@ -347,7 +346,7 @@ function PMA_DBI_get_fields_meta($result)
$fields = array();
$num_fields = mysql_num_fields($result);
for ($i = 0; $i < $num_fields; $i++) {
$fields[] = PMA_convert_display_charset(mysql_fetch_field($result, $i));
$fields[] = mysql_fetch_field($result, $i);
}
return $fields;
}
@@ -369,7 +368,7 @@ function PMA_DBI_field_name($result, $i)
function PMA_DBI_field_flags($result, $i)
{
return PMA_convert_display_charset(mysql_field_flags($result, $i));
return mysql_field_flags($result, $i);
}
?>

View File

@@ -194,7 +194,6 @@ function PMA_DBI_try_query($query, $link = null, $options = 0)
* @uses $GLOBALS['allow_recoding']
* @uses $GLOBALS['cfg']['AllowAnywhereRecoding']
* @uses PMA_DBI_get_fields_meta()
* @uses PMA_convert_display_charset()
* @uses mysqli_fetch_array()
* @uses mysqli_num_fields()
* @uses stristr()
@@ -321,7 +320,6 @@ function PMA_DBI_get_client_info()
/**
* returns last error message or false if no errors occured
*
* @uses PMA_convert_display_charset()
* @uses PMA_DBI_convert_message()
* @uses $GLOBALS['errno']
* @uses $GLOBALS['userlink']
@@ -600,7 +598,6 @@ function PMA_DBI_field_name($result, $i)
* @uses MYSQLI_PRI_KEY_FLAG
* @uses MYSQLI_NOT_NULL_FLAG
* @uses mysqli_fetch_field_direct()
* @uses PMA_convert_display_charset()
* @param object mysqli result $result
* @param integer $i field
* @return string field flags
@@ -626,7 +623,7 @@ function PMA_DBI_field_flags($result, $i)
if ($f & MYSQLI_UNIQUE_KEY_FLAG) { $flags .= 'unique_key ';}
if ($f & MYSQLI_PRI_KEY_FLAG) { $flags .= 'primary_key ';}
if ($f & MYSQLI_NOT_NULL_FLAG) { $flags .= 'not_null ';}
return PMA_convert_display_charset(trim($flags));
return trim($flags);
}
?>