Esempio n. 1
0
 /**
  * Takes an UTF-8 string and returns an array of ints representing the Unicode characters.
  * Astral planes are supported i.e. the ints in the output can be > 0xFFFF.
  * Occurrances of the BOM are ignored. Surrogates are not allowed.
  *
  * 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.
  * Ported to PHP by Henri Sivonen <*****@*****.**>, see http://hsivonen.iki.fi/php-utf8/.
  * Slight modifications to fit with phputf8 library by Harry Fuecks <*****@*****.**>.
  *
  * @param   string   UTF-8 encoded string
  * @return  array    unicode code points
  * @return  boolean  FALSE if the string is invalid
  */
 public static function to_unicode($str)
 {
     if (!isset(self::$called[__FUNCTION__])) {
         require SYSPATH . 'core/utf8/' . __FUNCTION__ . EXT;
         // Function has been called
         self::$called[__FUNCTION__] = TRUE;
     }
     return _to_unicode($str);
 }
Esempio n. 2
0
 /**
  * Takes an UTF-8 string and returns an array of ints representing the Unicode characters.
  * Astral planes are supported i.e. the ints in the output can be > 0xFFFF.
  * Occurrences of the BOM are ignored. Surrogates are not allowed.
  *
  *     $array = UTF8::to_unicode($str);
  *
  * 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.
  * Ported to PHP by Henri Sivonen <*****@*****.**>, see <http://hsivonen.iki.fi/php-utf8/>
  * Slight modifications to fit with phputf8 library by Harry Fuecks <*****@*****.**>
  *
  * @param   string  UTF-8 encoded string
  * @return  array   unicode code points
  * @return  FALSE   if the string is invalid
  */
 public static function to_unicode($str)
 {
     if (!isset(self::$called[__FUNCTION__])) {
         require SYSPATH . 'utf8' . DIRECTORY_SEPARATOR . __FUNCTION__ . EXT;
         // Function has been called
         self::$called[__FUNCTION__] = TRUE;
     }
     return _to_unicode($str);
 }
Esempio n. 3
0
 public static function to_unicode($str)
 {
     if (!isset(UTF8::$called[__FUNCTION__])) {
         require JsonApiApplication::find_file("utf8", __FUNCTION__);
         // Function has been called
         UTF8::$called[__FUNCTION__] = TRUE;
     }
     return _to_unicode($str);
 }
Esempio n. 4
0
 /**
  * Takes an UTF-8 string and returns an array of ints representing the Unicode characters.
  * Astral planes are supported i.e. the ints in the output can be > 0xFFFF.
  * Occurrances of the BOM are ignored. Surrogates are not allowed.
  *
  * 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.
  * Ported to PHP by Henri Sivonen <*****@*****.**>, see http://hsivonen.iki.fi/php-utf8/.
  * Slight modifications to fit with phputf8 library by Harry Fuecks <*****@*****.**>.
  *
  * @param   string   UTF-8 encoded string
  * @return  array    unicode code points
  * @return  boolean  FALSE if the string is invalid
  */
 public static function to_unicode($str)
 {
     require_once dirname(__FILE__) . '/' . __FUNCTION__ . '.php';
     return _to_unicode($str);
 }
Esempio n. 5
0
 /**
  * Takes an UTF-8 string and returns an array of ints representing the Unicode characters.
  * Astral planes are supported i.e. the ints in the output can be > 0xFFFF.
  * Occurrences of the BOM are ignored. Surrogates are not allowed.
  *
  *     $array = UTF8::to_unicode($str);
  *
  * 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.
  * Ported to PHP by Henri Sivonen <*****@*****.**>, see <http://hsivonen.iki.fi/php-utf8/>
  * Slight modifications to fit with phputf8 library by Harry Fuecks <*****@*****.**>
  *
  * @param   string  $str    UTF-8 encoded string
  * @return  array   unicode code points
  * @return  FALSE   if the string is invalid
  */
 public static function to_unicode($str)
 {
     if (!isset(UTF8::$called[__FUNCTION__])) {
         require Kohana::find_file('utf8', __FUNCTION__);
         // Function has been called
         UTF8::$called[__FUNCTION__] = TRUE;
     }
     return _to_unicode($str);
 }
Esempio n. 6
0
 /**
  * Takes an UTF-8 string and returns an array of ints representing the Unicode characters
  *
  * Astral planes are supported i.e. the ints in the output can be > 0xFFFF.
  * Occurrences of the BOM are ignored. Surrogates are not allowed.
  *
  * Example:
  * ~~~
  * $array = UTF8::to_unicode($str);
  * ~~~
  *
  * 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.
  * Ported to PHP by Henri Sivonen <*****@*****.**>, see <http://hsivonen.iki.fi/php-utf8/>
  * Slight modifications to fit with phputf8 library by Harry Fuecks <*****@*****.**>
  *
  * @param   string  $str  UTF-8 encoded string
  *
  * @return  array    mixed
  *
  * @uses    Kohana::find_file
  */
 public static function to_unicode($str)
 {
     UTF8::_load(__FUNCTION__);
     return _to_unicode($str);
 }