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


PHP eZCharsetInfo::characterEncodingScheme方法代码示例

本文整理汇总了PHP中eZCharsetInfo::characterEncodingScheme方法的典型用法代码示例。如果您正苦于以下问题:PHP eZCharsetInfo::characterEncodingScheme方法的具体用法?PHP eZCharsetInfo::characterEncodingScheme怎么用?PHP eZCharsetInfo::characterEncodingScheme使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在eZCharsetInfo的用法示例。


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

示例1: eZCodePage

 function eZCodePage($charset_code, $use_cache = true)
 {
     $this->RequestedCharsetCode = $charset_code;
     $this->CharsetCode = eZCharsetInfo::realCharsetCode($charset_code);
     $this->CharsetEncodingScheme = eZCharsetInfo::characterEncodingScheme($charset_code);
     $this->Valid = false;
     $this->SubstituteChar = 63;
     // the ? character
     $this->MinCharValue = 0;
     $this->MaxCharValue = 0;
     $this->load($use_cache);
 }
开发者ID:netbliss,项目名称:ezpublish,代码行数:12,代码来源:ezcodepage.php

示例2: instance

 /**
  * Returns a shared instance of the eZTextCodec pr the
  * $inputCharsetCode and $outputCharsetCode params.
  *
  * @param string|false $inputCharsetCode Uses {@link eZTextCodec::internalCharset()} if false
  * @param string|false $outputCharsetCode Uses {@link eZTextCodec::internalCharset()} if false
  * @param bool $alwaysReturn
  * @return eZTextCodec|null Returns null if $alwaysReturn is false and text codec is not needed for
  *         current $inputCharsetCode and $outputCharsetCode.
  */
 static function instance($inputCharsetCode, $outputCharsetCode = false, $alwaysReturn = true)
 {
     if ($inputCharsetCode === false or $outputCharsetCode === false) {
         if (isset($GLOBALS['eZTextCodecInternalCharsetReal'])) {
             $internalCharset = $GLOBALS['eZTextCodecInternalCharsetReal'];
         } else {
             $internalCharset = eZTextCodec::internalCharset();
         }
     }
     if ($inputCharsetCode === false) {
         $realInputCharsetCode = $inputCharsetCode = $internalCharset;
     } else {
         $realInputCharsetCode = eZCharsetInfo::realCharsetCode($inputCharsetCode);
     }
     if ($outputCharsetCode === false) {
         $realOutputCharsetCode = $outputCharsetCode = $internalCharset;
     } else {
         $realOutputCharsetCode = eZCharsetInfo::realCharsetCode($outputCharsetCode);
     }
     $check =& $GLOBALS["eZTextCodecCharsetCheck"]["{$realInputCharsetCode}-{$realOutputCharsetCode}"];
     if (!$alwaysReturn and isset($check) and !$check) {
         $check = null;
         return $check;
     }
     if (isset($check) and is_object($check)) {
         return $check;
     }
     if (!$realInputCharsetCode) {
         $realInputCharsetCode = eZCharsetInfo::realCharsetCode($inputCharsetCode);
     }
     if (!$realOutputCharsetCode) {
         $realOutputCharsetCode = eZCharsetInfo::realCharsetCode($outputCharsetCode);
     }
     $inputEncoding = eZCharsetInfo::characterEncodingScheme($realInputCharsetCode, true);
     $outputEncoding = eZCharsetInfo::characterEncodingScheme($realOutputCharsetCode, true);
     if (!$alwaysReturn and $inputEncoding == 'singlebyte' and $inputEncoding == $outputEncoding and $realInputCharsetCode == $realOutputCharsetCode) {
         $check = null;
         return $check;
     }
     $globalsKey = "eZTextCodec-{$realInputCharsetCode}-{$realOutputCharsetCode}";
     if (!isset($GLOBALS[$globalsKey]) || !$GLOBALS[$globalsKey] instanceof eZTextCodec) {
         $GLOBALS[$globalsKey] = new eZTextCodec($inputCharsetCode, $outputCharsetCode, $realInputCharsetCode, $realOutputCharsetCode, $inputEncoding, $outputEncoding);
     }
     $check = $GLOBALS[$globalsKey];
     return $GLOBALS[$globalsKey];
 }
开发者ID:patrickallaert,项目名称:ezpublish-legacy-php7,代码行数:56,代码来源:eztextcodec.php


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