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