[ Index ] |
PHP Cross Reference of Joomla 4.2.2 documentation |
[Source view] [Print] [Project Stats]
Tools for conversion between UTF-8 and unicode The Original Code is Mozilla Communicator client code. The Initial Developer of the Original Code is Netscape Communications Corporation. Portions created by the Initial Developer are Copyright (C) 1998 the Initial Developer. All Rights Reserved. Ported to PHP by Henri Sivonen (http://hsivonen.iki.fi) Slight modifications to fit with phputf8 library by Harry Fuecks (hfuecks gmail com)
File Size: | 271 lines (10 kb) |
Included or required: | 1 time |
Referenced: | 0 times |
Includes or requires: | 0 files |
utf8_to_unicode($str) X-Ref |
Takes an UTF-8 string and returns an array of ints representing the Unicode characters. Astral planes are supported ie. the ints in the output can be > 0xFFFF. Occurrances of the BOM are ignored. Surrogates are not allowed. Returns false if the input string isn't a valid UTF-8 octet sequence and raises a PHP error at level E_USER_WARNING Note: this function has been modified slightly in this library to trigger errors on encountering bad bytes Joomla modification - As of PHP 7.4, curly brace access has been deprecated. As a result this function has been modified to use square brace syntax See https://github.com/php/php-src/commit/d574df63dc375f5fc9202ce5afde23f866b6450a for additional references author: <[email protected]> param: string UTF-8 encoded string return: mixed array of unicode code points or FALSE if UTF-8 invalid |
utf8_from_unicode($arr) X-Ref |
Takes an array of ints representing the Unicode characters and returns a UTF-8 string. Astral planes are supported ie. the ints in the input can be > 0xFFFF. Occurrances of the BOM are ignored. Surrogates are not allowed. Returns false if the input array contains ints that represent surrogates or are outside the Unicode range and raises a PHP error at level E_USER_WARNING Note: this function has been modified slightly in this library to use output buffering to concatenate the UTF-8 string (faster) as well as reference the array by it's keys author: <[email protected]> param: array of unicode code points representing a string return: mixed UTF-8 string or FALSE if array contains invalid code points |
Generated: Wed Sep 7 05:41:13 2022 | Chilli.vc Blog - For Webmaster,Blog-Writer,System Admin and Domainer |