[ Index ] |
PHP Cross Reference of DokuWiki |
[Source view] [Print] [Project Stats]
(no description)
File Size: | 158 lines (4 kb) |
Included or required: | 0 times |
Referenced: | 0 times |
Includes or requires: | 0 files |
Conversion:: (6 methods):
toHtml()
fromHtml()
decodeAnyEntity()
decodeNumericEntity()
toUtf16be()
fromUtf16be()
Class: Conversion - X-Ref
Methods to convert from and to UTF-8 stringstoHtml($str, $all = false) X-Ref |
Encodes UTF-8 characters to HTML entities param: string $str param: bool $all Encode non-utf8 char to HTML as well link: http://php.net/manual/en/function.utf8-decode.php return: string author: Tom N Harris <tnharris@whoopdedo.org> author: <vpribish at shopping dot com> |
fromHtml($str, $entities = false) X-Ref |
Decodes HTML entities to UTF-8 characters Convert any &#..; entity to a codepoint, The entities flag defaults to only decoding numeric entities. Pass HTML_ENTITIES and named entities, including & < etc. are handled as well. Avoids the problem that would occur if you had to decode "&#38;&amp;#38;" unhtmlspecialchars(\dokuwiki\Utf8\Conversion::fromHtml($s)) -> "&&" \dokuwiki\Utf8\Conversion::fromHtml(unhtmlspecialchars($s)) -> "&&#38;" what it should be -> "&&#38;" param: string $str UTF-8 encoded string param: boolean $entities decode name entities in addtition to numeric ones return: string UTF-8 encoded string with numeric (and named) entities replaced. author: Tom N Harris <tnharris@whoopdedo.org> |
decodeAnyEntity($ent) X-Ref |
Decodes any HTML entity to it's correct UTF-8 char equivalent param: string $ent An entity return: string |
decodeNumericEntity($ent) X-Ref |
Decodes numeric HTML entities to their correct UTF-8 characters param: $ent string A numeric entity return: string|false |
toUtf16be($str, $bom = false) X-Ref |
UTF-8 to UTF-16BE conversion. Maybe really UCS-2 without mb_string due to utf8_to_unicode limits param: string $str param: bool $bom return: string |
fromUtf16be($str) X-Ref |
UTF-8 to UTF-16BE conversion. Maybe really UCS-2 without mb_string due to utf8_to_unicode limits param: string $str return: false|string |