Server IP : 127.0.0.2 / Your IP : 18.117.111.63 Web Server : Apache/2.4.18 (Ubuntu) System : User : www-data ( ) PHP Version : 7.0.33-0ubuntu0.16.04.16 Disable Function : disk_free_space,disk_total_space,diskfreespace,dl,exec,fpaththru,getmyuid,getmypid,highlight_file,ignore_user_abord,leak,listen,link,opcache_get_configuration,opcache_get_status,passthru,pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,php_uname,phpinfo,posix_ctermid,posix_getcwd,posix_getegid,posix_geteuid,posix_getgid,posix_getgrgid,posix_getgrnam,posix_getgroups,posix_getlogin,posix_getpgid,posix_getpgrp,posix_getpid,posix,_getppid,posix_getpwnam,posix_getpwuid,posix_getrlimit,posix_getsid,posix_getuid,posix_isatty,posix_kill,posix_mkfifo,posix_setegid,posix_seteuid,posix_setgid,posix_setpgid,posix_setsid,posix_setuid,posix_times,posix_ttyname,posix_uname,pclose,popen,proc_open,proc_close,proc_get_status,proc_nice,proc_terminate,shell_exec,source,show_source,system,virtual MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : ON | Pkexec : ON Directory : /usr/share/phpmyadmin/libraries/ |
Upload File : |
<?php /* vim: set expandtab sw=4 ts=4 sts=4: */ /** * Charset conversion functions. * * @package PhpMyAdmin */ if (! defined('PHPMYADMIN')) { exit; } define('PMA_CHARSET_NONE', 0); define('PMA_CHARSET_ICONV', 1); define('PMA_CHARSET_RECODE', 2); define('PMA_CHARSET_ICONV_AIX', 3); define('PMA_CHARSET_MB', 4); if (! isset($GLOBALS['cfg']['RecodingEngine'])) { $GLOBALS['cfg']['RecodingEngine'] = ''; } // Finally detect which function we will use: if ($GLOBALS['cfg']['RecodingEngine'] == 'iconv') { if (@function_exists('iconv')) { $PMA_recoding_engine = PMA_getIconvRecodingEngine(); } else { $PMA_recoding_engine = PMA_CHARSET_NONE; PMA_warnMissingExtension('iconv'); } } elseif ($GLOBALS['cfg']['RecodingEngine'] == 'recode') { if (@function_exists('recode_string')) { $PMA_recoding_engine = PMA_CHARSET_RECODE; } else { $PMA_recoding_engine = PMA_CHARSET_NONE; PMA_warnMissingExtension('recode'); } } elseif ($GLOBALS['cfg']['RecodingEngine'] == 'mb') { if (@function_exists('mb_convert_encoding')) { $PMA_recoding_engine = PMA_CHARSET_MB; } else { $PMA_recoding_engine = PMA_CHARSET_NONE; PMA_warnMissingExtension('mbstring'); } } elseif ($GLOBALS['cfg']['RecodingEngine'] == 'auto') { /* * We also need to verify iconv works, see * https://github.com/phpmyadmin/phpmyadmin/issues/11787/ * and * https://bugs.php.net/bug.php?id=44096 */ if (@function_exists('iconv') && @iconv_strlen('', 'cp1250') !== false) { $PMA_recoding_engine = PMA_getIconvRecodingEngine(); } elseif (@function_exists('recode_string')) { $PMA_recoding_engine = PMA_CHARSET_RECODE; } elseif (@function_exists('mb_convert_encoding')) { $PMA_recoding_engine = PMA_CHARSET_MB; } else { $PMA_recoding_engine = PMA_CHARSET_NONE; } } else { $PMA_recoding_engine = PMA_CHARSET_NONE; } /* Load AIX iconv wrapper if needed */ if ($PMA_recoding_engine == PMA_CHARSET_ICONV_AIX) { include_once './libraries/iconv_wrapper.lib.php'; } /** * Determines the correct recoding engine to use * * @return int $PMA_recoding_engine * * @access public * */ function PMA_getIconvRecodingEngine() { if ((@stristr(PHP_OS, 'AIX')) && (@strcasecmp(ICONV_IMPL, 'unknown') == 0) && (@strcasecmp(ICONV_VERSION, 'unknown') == 0) ) { return PMA_CHARSET_ICONV_AIX; } else { return PMA_CHARSET_ICONV; } } /** * Converts encoding of text according to parameters with detected * conversion function. * * @param string $src_charset source charset * @param string $dest_charset target charset * @param string $what what to convert * * @return string converted text * * @access public * */ function PMA_convertString($src_charset, $dest_charset, $what) { if ($src_charset == $dest_charset) { return $what; } switch ($GLOBALS['PMA_recoding_engine']) { case PMA_CHARSET_RECODE: return recode_string($src_charset . '..' . $dest_charset, $what); case PMA_CHARSET_ICONV: return iconv( $src_charset, $dest_charset . $GLOBALS['cfg']['IconvExtraParams'], $what ); case PMA_CHARSET_ICONV_AIX: return PMA_convertAIXIconv( $src_charset, $dest_charset . $GLOBALS['cfg']['IconvExtraParams'], $what ); case PMA_CHARSET_MB: return mb_convert_encoding( $what, $dest_charset, $src_charset ); default: return $what; } } // end of the "PMA_convertString()" function