本文整理匯總了PHP中TYPO3\CMS\Core\Charset\CharsetConverter::utf8_to_entities方法的典型用法代碼示例。如果您正苦於以下問題:PHP CharsetConverter::utf8_to_entities方法的具體用法?PHP CharsetConverter::utf8_to_entities怎麽用?PHP CharsetConverter::utf8_to_entities使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類TYPO3\CMS\Core\Charset\CharsetConverter
的用法示例。
在下文中一共展示了CharsetConverter::utf8_to_entities方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: makeEntities
/**
* Will convert the input strings special chars (all above 127) to entities.
* The string is expected to be encoded in UTF-8
* This function is used to create strings that can be used in the Click Menu
* (Context Sensitive Menus). The reason is that the values that are dynamically
* written into the <div> layer is decoded as iso-8859-1 no matter what charset
* is used in the document otherwise (only MSIE, Mozilla is OK).
* So by converting we by-pass this problem.
*
* @param string $str Input string
* @return string Output string
*/
public function makeEntities($str)
{
// Convert string back again, but using the full entity conversion:
return $this->csConvObj->utf8_to_entities($str);
}
示例2: makeEntities
/**
* Will convert the input strings special chars (all above 127) to entities.
* The string is expected to be encoded in UTF-8
* This function is used to create strings that can be used in the Click Menu
* (Context Sensitive Menus). The reason is that the values that are dynamically
* written into the <div> layer is decoded as iso-8859-1 no matter what charset
* is used in the document otherwise (only MSIE, Mozilla is OK).
* So by converting we by-pass this problem.
*
* @param string $str Input string
* @return string Output string
* @deprecated since TYPO3 v8, will be removed in TYPO3 v9
*/
public function makeEntities($str)
{
GeneralUtility::logDeprecatedFunction();
// Convert string back again, but using the full entity conversion:
return $this->csConvObj->utf8_to_entities($str);
}