Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function myiconv($in_enc, $out_enc, $string)
- {
- global $_utf8win1251, $_win1251utf8;
- if ($in_enc == $out_enc) {
- return $string;
- }
- if (function_exists('iconv')) {
- $converted = @iconv($in_enc, $out_enc, $string);
- if ($converted !== FALSE) {
- return $converted;
- }
- }
- if ($in_enc == "cp1251" && $out_enc == "utf-8")
- return strtr($string, $_win1251utf8);
- if ($in_enc == "utf-8" && $out_enc == "cp1251")
- return strtr($string, $_utf8win1251);
- return $string; // do not know how to convert
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement