Merged patch #729514 - support for iconv parameters.

This commit is contained in:
Michal Čihař
2003-05-11 17:29:53 +00:00
parent 864b9beb07
commit 38db258110
5 changed files with 32 additions and 4 deletions

View File

@@ -5,6 +5,12 @@ phpMyAdmin - Changelog
$Id$
$Source$
2003-05-10 Michal Cihar <nijel@users.sourceforge.net>
* Documentation.html, config.inc.php3,
libraries/charset_conversion.lib.php3, libraries/config_import.lib.php3:
Merged patch #729514 - support for iconv parameters.
2003-05-11 Marc Delisle <lem9@users.sourceforge.net>
### 2.5.0 released

View File

@@ -1325,6 +1325,15 @@ $cfg['PmaAbsoluteUri'] = (!empty($_SERVER['HTTPS']) ? 'https' : 'http') . '://'
<br /><br />
</dd>
<dt><b>$cfg['IconvExtraParams'] </b>string</dt>
<dd>
Specify some parameters for iconv used in charset conversion. See
<a
href="http://www.gnu.org/software/libiconv/documentation/libiconv/iconv_open.3.html">iconv
documentation</a> for details.
<br /><br />
</dd>
<dt><b>$cfg['AvailableCharsets'] </b>array</dt>
<dd>
Available character sets for MySQL conversion. You can add your own (any of

View File

@@ -315,6 +315,11 @@ $cfg['AllowAnywhereRecoding'] = FALSE;
// recode - use recode_string function
$cfg['RecodingEngine'] = 'auto';
// Specify some parameters for iconv used in charset conversion. See iconv
// documentation for details:
// http://www.gnu.org/software/libiconv/documentation/libiconv/iconv_open.3.html
$cfg['IconvExtraParams'] = '//IGNORE';
// Available charsets for MySQL conversion. currently contains all which could
// be found in lang/* files and few more.
// Charsets will be shown in same order as here listed, so if you frequently

View File

@@ -82,6 +82,10 @@ if (!defined('PMA_CHARSET_CONVERSION_LIB_INCLUDED')){
define('PMA_CHARSET_LIBICONV', 2);
define('PMA_CHARSET_RECODE', 3);
if (!isset($cfg['IconvExtraParams'])) {
$cfg['IconvExtraParams'] = '//IGNORE';
}
// Finally detects which function will we use:
if (isset($cfg['AllowAnywhereRecoding'])
&& $cfg['AllowAnywhereRecoding']
@@ -185,7 +189,7 @@ if (!defined('PMA_CHARSET_CONVERSION_LIB_INCLUDED')){
return recode_string($convcharset . '..' . $charset, $what);
break;
case PMA_CHARSET_ICONV:
return iconv($convcharset, $charset, $what);
return iconv($convcharset, $charset . $cfg['IconvExtraParams'], $what);
break;
case PMA_CHARSET_LIBICONV:
return libiconv($convcharset, $charset, $what);
@@ -241,7 +245,7 @@ if (!defined('PMA_CHARSET_CONVERSION_LIB_INCLUDED')){
return recode_string($charset . '..' . $convcharset, $what);
break;
case PMA_CHARSET_ICONV:
return iconv($charset, $convcharset, $what);
return iconv($charset, $convcharset . $cfg['IconvExtraParams'], $what);
break;
case PMA_CHARSET_LIBICONV:
return libiconv($charset, $convcharset, $what);
@@ -272,7 +276,7 @@ if (!defined('PMA_CHARSET_CONVERSION_LIB_INCLUDED')){
return recode_string($src_charset . '..' . $dest_charset, $what);
break;
case PMA_CHARSET_ICONV:
return iconv($src_charset, $dest_charset, $what);
return iconv($src_charset, $dest_charset . $GLOBALS['cfg']['IconvExtraParams'], $what);
break;
case PMA_CHARSET_LIBICONV:
return libiconv($src_charset, $dest_charset, $what);
@@ -312,7 +316,7 @@ if (!defined('PMA_CHARSET_CONVERSION_LIB_INCLUDED')){
while (!feof($fin)) {
$line = fgets($fin, 4096);
if ($GLOBALS['PMA_recoding_engine'] == PMA_CHARSET_ICONV) {
$dist = iconv($src_charset, $dest_charset, $line);
$dist = iconv($src_charset, $dest_charset . $GLOBALS['cfg']['IconvExtraParams'], $line);
} else {
$dist = libiconv($src_charset, $dest_charset, $line);
}

View File

@@ -482,6 +482,10 @@ if (!defined('PMA_CONFIG_IMPORT_LIB_INCLUDED')) {
$cfg['AllowAnywhereRecoding'] = FALSE;
}
if (!isset($cfg['IconvExtraParams'])) {
$cfg['IconvExtraParams'] = '//IGNORE';
}
if (!isset($cfg['Lang']) &&isset($cfgLang)) {
$cfg['Lang'] = $cfgLang;
unset($cfgLang);