function Convert($aTxt, $aFF) { if (LANGUAGE_GREEK) { if (GREEK_FROM_WINDOWS) { $unistring = LanguageConv::gr_win2uni($aTxt); } else { $unistring = LanguageConv::gr_iso2uni($aTxt); } return $unistring; } elseif (LANGUAGE_CYRILLIC) { if (CYRILLIC_FROM_WINDOWS && (!defined('LANGUAGE_CHARSET') || stristr(LANGUAGE_CHARSET, 'windows-1251'))) { $aTxt = convert_cyr_string($aTxt, "w", "k"); } if (!defined('LANGUAGE_CHARSET') || stristr(LANGUAGE_CHARSET, 'koi8-r') || stristr(LANGUAGE_CHARSET, 'windows-1251')) { $isostring = convert_cyr_string($aTxt, "k", "i"); $unistring = LanguageConv::iso2uni($isostring); } else { $unistring = $aTxt; } return $unistring; } elseif ($aFF === FF_SIMSUN) { // Do Chinese conversion if ($this->g2312 == null) { include_once 'jpgraph_gb2312.php'; $this->g2312 = new GB2312toUTF8(); } return $this->g2312->gb2utf8($aTxt); } elseif ($aFF === FF_CHINESE) { if (!function_exists('iconv')) { JpGraphError::RaiseL(25006); //('Usage of FF_CHINESE (FF_BIG5) font family requires that your PHP setup has the iconv() function. By default this is not compiled into PHP (needs the "--width-iconv" when configured).'); } return iconv('BIG5', 'UTF-8', $aTxt); } elseif (ASSUME_EUCJP_ENCODING && ($aFF == FF_MINCHO || $aFF == FF_GOTHIC || $aFF == FF_PMINCHO || $aFF == FF_PGOTHIC)) { if (!function_exists('mb_convert_encoding')) { JpGraphError::RaiseL(25127); } return mb_convert_encoding($aTxt, 'UTF-8', 'EUC-JP'); } elseif ($aFF == FF_DAVID || $aFF == FF_MIRIAM || $aFF == FF_AHRON) { return LanguageConv::heb_iso2uni($aTxt); } else { return $aTxt; } }
function Convert($aTxt, $aFF) { if (LANGUAGE_GREEK) { if (GREEK_FROM_WINDOWS) { $unistring = LanguageConv::gr_win2uni($aTxt); } else { $unistring = LanguageConv::gr_iso2uni($aTxt); } return $unistring; } elseif (LANGUAGE_CYRILLIC) { if (CYRILLIC_FROM_WINDOWS && (!defined('CYRILLIC_LANGUAGE_CHARSET') || stristr(CYRILLIC_LANGUAGE_CHARSET, 'windows-1251'))) { $aTxt = convert_cyr_string($aTxt, "w", "k"); } if (!defined('CYRILLIC_LANGUAGE_CHARSET') || stristr(CYRILLIC_LANGUAGE_CHARSET, 'koi8-r') || stristr(CYRILLIC_LANGUAGE_CHARSET, 'windows-1251')) { $isostring = convert_cyr_string($aTxt, "k", "i"); $unistring = LanguageConv::iso2uni($isostring); } else { $unistring = $aTxt; } return $unistring; } elseif ($aFF === FF_SIMSUN) { if ($this->g2312 == null) { include_once 'jpgraph_gb2312.php'; $this->g2312 = new GB2312toUTF8(); } return $this->g2312->gb2utf8($aTxt); } elseif ($aFF === FF_CHINESE) { if (!function_exists('iconv')) { JpGraphError::RaiseL(25006); } return iconv('BIG5', 'UTF-8', $aTxt); } elseif (ASSUME_EUCJP_ENCODING && ($aFF == FF_MINCHO || $aFF == FF_GOTHIC || $aFF == FF_PMINCHO || $aFF == FF_PGOTHIC)) { if (!function_exists('mb_convert_encoding')) { JpGraphError::RaiseL(25127); } return mb_convert_encoding($aTxt, 'UTF-8', 'EUC-JP'); } elseif ($aFF == FF_DAVID || $aFF == FF_MIRIAM || $aFF == FF_AHRON) { return $this->heb_iso2uni($aTxt); } else { return $aTxt; } }