|
Project Information
-
Project feeds
- Code license
-
Other Open Source
See source for details
-
Labels
PHP,
UTF8,
PHP5,
iconv,
mbstring,
recode,
Unicode,
convert,
charset,
UTF16,
UTF32,
UCS2,
cp1251,
codepoint,
string
Featured
|
PHP5 UTF-8 is a UTF-8 aware library of functions mirroring PHP's own string functionsThe powerful solution/contribution for UTF-8 support in your framework/CMS, written on PHP. This library is advance of http://sourceforge.net/projects/phputf8 (last updated in 2007). UTF-8 support in PHP 5. Features and benefits - Compatibility with the interface standard PHP functions that deal with single-byte encodings
- Ability to work without PHP extensions ICONV and MBSTRING, if any, that are actively used! Uses the fastest available method between MBSTRING, ICONV, native on PHP and hacks.
- Useful features are missing from the ICONV and MBSTRING
- The methods that take and return a string, are able to take and return null. This useful for selects from a database.
- Several methods are able to process arrays recursively: array_change_key_case(), convert_from(), convert_to(), strict(), is_utf8(), blocks_check(), convert_case(), lowercase(), uppercase(), unescape()
- Validating method parameters to allowed types via reflection (You can disable it)
- A single interface and encapsulation, You can inherit and override
- Test coverage
- PHP >= 5.3.x
Overview In Russian: Поддержка UTF-8 в PHP 5. Возможности и преимущества - Совместимость с интерфейсом стандартных PHP функций, работающих с однобайтовыми кодировками
- Возможность работы без PHP расширений ICONV и MBSTRING, если они есть, то активно используются! Используется наиболее быстрый из доступных методов между MBSTRING, ICONV, родной реализацией на PHP и хаками.
- Полезные функции, отсутствующие в ICONV и MBSTRING
- Методы, которые принимают и возвращают строку, умеют принимать и возвращать null. Это удобно при выборках значений из базы данных.
- Несколько методов умеют обрабатывать массивы рекурсивно: array_change_key_case(), convert_from(), convert_to(), strict(), is_utf8(), blocks_check(), convert_case(), lowercase(), uppercase(), unescape()
- Проверка у методов входных параметров на допустимые типы через рефлексию (можно отключить)
- Единый интерфейс и инкапсуляция, можно унаследоваться и переопределить методы
- Покрытие тестами
- PHP >= 5.3.x
Обзор Example: $s = 'Hello, Привет';
if (UTF8::is_utf8($s)) echo UTF8::strlen($s);
|