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


PHP CharsetConverter::convertCharset方法代码示例

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


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

示例1: referenceItemsStart

 public function referenceItemsStart($path, $attr)
 {
     if ($this->NS["fp"] <= 0) {
         $this->error = GetMessage("CC_BCIH_XML_PARSE_ERROR", array("#CODE#" => 10));
     } else {
         $this->deleteBySessid($this->NS["HL"], $this->NS["SESSID"]);
         $xmlPosition = $this->xmlStream->getPosition();
         $filePosition = $this->decodePostion($xmlPosition);
         $xmlString = $this->xmlStream->readFilePart($this->NS["fp"], $filePosition);
         $error = "";
         if ($xmlPosition[0]) {
             $xmlString = CharsetConverter::convertCharset($xmlString, $xmlPosition[0], LANG_CHARSET, $error);
         }
         $xmlString .= "</" . GetMessage("CC_BCIH_XML_REFERENCE") . ">";
         $xmlObject = new CDataXML();
         if ($xmlObject->loadString($xmlString)) {
             $highBlockID = $this->checkReference($xmlObject->GetArray());
             $this->dataClass = "";
             $this->step = true;
             $this->message = GetMessage("CC_BCIH_REFERENCE_FOUND_OR_CREATED", array("#CODE#" => $highBlockID));
             if ($highBlockID > 0) {
                 $this->NS["HL"] = $highBlockID;
                 $this->NS["FM"] = array();
                 $this->NS["C"] = 0;
             } else {
                 $this->error = GetMessage("CC_BCIH_XML_PARSE_ERROR", array("#CODE#" => 30));
             }
         } else {
             $this->error = GetMessage("CC_BCIH_XML_PARSE_ERROR", array("#CODE#" => 20));
         }
     }
 }
开发者ID:Satariall,项目名称:izurit,代码行数:32,代码来源:class.php

示例2: readXml

 /**
  * Reads xml chunk from the file preserving it's position
  *
  * @param int $startPosition
  * @param int $endPosition
  * @return CDataXML|false
  */
 private function readXml($startPosition, $endPosition)
 {
     $savedPosition = ftell($this->fileHandler);
     fseek($this->fileHandler, $startPosition);
     $xmlChunk = fread($this->fileHandler, $endPosition - $startPosition);
     fseek($this->fileHandler, $savedPosition);
     if ($xmlChunk && $this->fileCharset) {
         $error = "";
         $xmlChunk = CharsetConverter::convertCharset($xmlChunk, $this->fileCharset, LANG_CHARSET, $error);
     }
     $xmlObject = new CDataXML();
     if ($xmlObject->loadString($xmlChunk)) {
         return $xmlObject;
     } else {
         return false;
     }
 }
开发者ID:k-kalashnikov,项目名称:geekcon_new,代码行数:24,代码来源:xml.php

示例3: readXml

 /**
  * Reads xml chunk from the file preserving it's position
  *
  * @param int $startPosition
  * @param int $endPosition
  * @return CDataXML|false
  */
 private function readXml($startPosition, $endPosition)
 {
     $xmlChunk = $this->readFilePart($startPosition, $endPosition);
     if ($xmlChunk && $this->fileCharset) {
         $error = "";
         $xmlChunk = CharsetConverter::convertCharset($xmlChunk, $this->fileCharset, LANG_CHARSET, $error);
     }
     $xmlObject = new CDataXML();
     if ($xmlObject->loadString($xmlChunk)) {
         return $xmlObject;
     } else {
         return false;
     }
 }
开发者ID:Satariall,项目名称:izurit,代码行数:21,代码来源:xml.php


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