本文整理汇总了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));
}
}
}
示例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;
}
}
示例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;
}
}