class utf8
A port of phputf8 to a unified file/class. Checks PHP status to ensure that
UTF-8 support is available and normalize global variables to UTF-8. It also
provides multi-byte aware replacement string functions.
This file is licensed differently from the rest of Kohana. As a port of
phputf8, which is LGPL software, this file is released under the LGPL.
PCRE needs to be compiled with UTF-8 support (--enable-utf8).
Support for Unicode properties is highly recommended (--enable-unicode-properties). AuthorsFunctions
| Name | Visibility | Description |
| clean | public (static) | Recursively cleans arrays, objects, and strings. Removes ASCII control |
| isAscii | public (static) | Tests whether a string contains only 7bit ASCII bytes. This is used to |
| stripAsciiCtrl | public (static) | Strips out device control codes in the ASCII range. |
| stripNonAscii | public (static) | Strips out all non-7bit ASCII bytes. |
object|array|string utf8::clean ( string|array|object $str );
Recursively cleans arrays, objects, and strings. Removes ASCII control
codes and converts to UTF-8 while silently discarding incompatible
UTF-8 characters. bool utf8::isAscii ( string $str );
Tests whether a string contains only 7bit ASCII bytes. This is used to
determine when to use native functions or UTF-8 functions. string utf8::stripAsciiCtrl ( string $str );
Strips out device control codes in the ASCII range. string utf8::stripNonAscii ( string $str );
Strips out all non-7bit ASCII bytes. See also
|