voku/portable-utf8
Portable UTF-8 library - performance optimized (unicode) string functions for php.
6.1.1
24M downloads/mo
#1098 most downloaded on Packagist
voku/portable-utf8
What this package is like to depend on
Last release 4 months ago
17 Apr 2026
Ships unpredictably
gaps range from 3 weeks to 3.1 years
Some releases are documented
notes for 98 of 237 stable releases
Nothing withdrawn
no release was ever pulled
12 years old
237 releases · first in 2014
2 releases in the last 12 months
see the full history below
Release timeline
237 releases · Dec 2014 to Apr 2026Releases
latest 60 of 237-
6.1.117 Apr 2026 -
6.1.017 Apr 2026Release notes
Open source →- run all checks and tests up to PHP 8.5
- raise the minimum PHP version from 7.0 to 7.1
- PHP 8.5 compatibility: guard
ReflectionProperty::setAccessible()/ReflectionMethod::setAccessible()(deprecated since PHP 8.1), replacenullarray keys with empty-string keys - PHP 8.4 compatibility: updated nullable parameter types and resolved deprecations
- addressed PHP 8.2 variable interpolation and float-to-int deprecation warnings
- fixed "UTF8::strcmp()" for negative values and older PHP versions
- fixed "UTF8::substr_compare()" results across PHP versions
- fixed "UTF8::substr_in_byte()" to correctly handle PHP 7.x
falsereturn fromsubstr() - fixed "UTF8::str_camelize()" for all-caps inputs (e.g.
FOO BAR→fooBar,API2URL→api2Url) - fixed
mb_regex_encoding()call when PHP is built with--disable-mbregex - fixed
utf8_decode()truncated-sequence warning and improved handling of invalid/truncated UTF-8 sequences - fixed "Bootup" class to no longer mutate global
mbstringencoding settings during bootstrap; added opt-out viaPORTABLE_UTF8__DISABLE_AUTO_ENCODING - removed incorrect annotation from "Bootup" class
- migrated static analysis to PHPStan 2.x
-
6.0.1308 Mar 2023 -
6.0.1211 Jan 2023 -
6.0.1116 Dec 2022Release notes
Open source →- test with PHP 8.2
- added "UTF8::getUrlParamFromArray()": Get data from an array via array like string.
-
6.0.1005 Oct 2022 -
6.0.901 Sep 2022 -
6.0.831 Aug 2022 -
6.0.731 Aug 2022 -
6.0.631 Aug 2022Release notes
Open source →- optimize phpdocs
- optimize "from"-encoding in "UTF8::encode()"
- fix error handling in "UTF8::str_split()" for PHP >= 8.0
- fix error handling in "UTF8::str_capitalize_name_helper()" for PHP >= 8.0
-
6.0.510 Aug 2022 -
6.0.408 Mar 2022Release notes
Open source →- "To people of Russia": There is a war in Ukraine right now. The forces of the Russian Federation are attacking civilians.
-
6.0.330 Jan 2022 -
6.0.224 Jan 2022 -
6.0.124 Jan 2022 -
6.0.008 Dec 2021Release notes
Open source →Removed:
- Bootup::filterRequestInputs();
- Bootup::filterRequestUri();
- UTF8::GRAPHEME_CLUSTER_RX
- UTF8::chr_to_int() (please use UTF8::chr_to_decimal())
- UTF8::hasBom() (please use UTF8::string_has_bom())
- UTF8::html_decode() (please use UTF8::html_entity_decode())
- UTF8::int_to_chr() (please use UTF8::decimal_to_chr())
- UTF8::isAscii() (please use UTF8::is_ascii())
- UTF8::isBase64() (please use UTF8::is_base64())
- UTF8::isBinary() (please use UTF8::is_binary())
- UTF8::isBom() (please use UTF8::is_bom())
- UTF8::isHtml() (please use UTF8::is_html())
- UTF8::isJson() (please use UTF8::is_json())
- UTF8::isUtf16() (please use UTF8::is_utf16())
- UTF8::isUtf32() (please use UTF8::is_utf32())
- UTF8::isUtf8() (please use UTF8::is_utf8())
- UTF8::lcword() (please use UTF8::lcfirst())
- UTF8::lowerCaseFirst() (please use UTF8::lcfirst())
- UTF8::normalizeEncoding() (please use UTF8::normalize_encoding())
- UTF8::removeBOM() (please use UTF8::remove_bom())
- UTF8::split() (please use UTF8::str_split())
- UTF8::str_begins() (please use UTF8::str_starts_with())
- UTF8::str_ends() (please use UTF8::str_ends_with())
- UTF8::str_ibegins() (please use UTF8::str_istarts_with())
- UTF8::str_iends() (please use UTF8::str_iends_with())
- UTF8::str_iindex_first() (please use UTF8::stripos())
- UTF8::str_iindex_last() (please use UTF8::strripos())
- UTF8::str_index_first() (please use UTF8::strpos())
- UTF8::str_index_last() (please use UTF8::strrpos())
- UTF8::str_transliterate() (please use UTF8::to_ascii())
- UTF8::str_upper_first() (please use UTF8::ucfirst())
- UTF8::strchr() (please use UTF8::strstr())
- UTF8::strichr() (please use UTF8::stristr())
- UTF8::toAscii() (please use UTF8::to_ascii())
- UTF8::toIso8859() (please use UTF8::to_iso8859())
- UTF8::toLatin1() (please use UTF8::to_iso8859())
- UTF8::to_latin1() (please use UTF8::to_iso8859())
- UTF8::toUTF8() (please use UTF8::to_utf8())
- UTF8::ucword() (please use UTF8::ucfirst())
- UTF8::urldecode_fix_win1252_chars() (please use UTF8::urldecode())
- UTF8::utf8_fix_win1252_chars() (please use UTF8::fix_simple_utf8())
Fixed:
- "UTF8::is_binary()" -> fix for strict usage
-
5.4.5102 Dec 2020Release notes
Open source →- "UTF8::rawurldecode()" -> optimize performance
- "UTF8::urldecode()" -> optimize performance
- "UTF8::to_boolean() -> fix phpdoc
-
5.4.5012 Nov 2020Release notes
Open source →- "UTF8::normalize_whitespace()" -> can now also normalize "control characters" if needed
-
5.4.4911 Nov 2020Release notes
Open source →- "UTF8::remove_invisible_characters()" -> can now also remove "control characters" if needed
- "UTF8::is_printable()" -> fix for non-printable control characters
-
5.4.4807 Nov 2020Release notes
Open source →- fix "UTF8::chr()" handling of non "int" code points
- fix "UTF8::html_encode()" (parameter mismatch for "mb_encode_numericentity()")
- fix "UTF8::str_ireplace()" (TypeError of "preg_replace()")
- fix "UTF8::strtonatfold()" (TypeError of "preg_replace()")
- fix "UTF8::substr_count()" return type if "$haystack" is an empty string
- compatibility with PHP 8.0 behaviour for:
- UTF::strstr()
- UTF::stristr()
- UTF::strpos()
- UTF::stripos()
- UTF::strrpos()
- UTF::strripos()
- use native functions from PHP 8.0
- \str_contains()
- \str_starts_with()
- \str_ends_with()
-
5.4.4726 Jul 2020 -
5.4.4618 Jul 2020 -
5.4.4526 May 2020 -
5.4.4423 May 2020 -
5.4.4314 May 2020Release notes
Open source →- fix auto-generate the "API documentation" in the README (via generate_docs.php)
- optimize phpdoc comments
- fix autoloader for test files
-
5.4.4205 May 2020Release notes
Open source →- add "UTF8::css_identifier()"
- optimize phpdoc comments
- use more template phpdoc-annotation (supported by phpstan and psalm)
- move code examples into the code
- auto-generate the "API documentation" in the README (via generate_docs.php)
-
5.4.4106 Mar 2020Release notes
Open source →- fix "UTF8::is_utf8*" -> detecting when last byte is incomplete multibyte character | big thanks @daniel-jeffery
-
5.4.4022 Feb 2020 -
5.4.3930 Jan 2020Release notes
Open source →- "GRAPHEME_CLUSTER_RX" -> is not used anymore and is now deprecated
- fix "UTF8::decode_mimeheader" fallback -> now we always use the symfony polyfill (mb_decode_mimeheader has different results)
- fix "UTF8::get_unique_string()" -> use "mt_rand" as fallback
- fix "UTF8::strtr()" -> now it works also with arrays
- fix phpdoc for "UTF8::normalize_line_ending()"
- fix phpdoc for "UTF8::split()" & "UTF8::str_split()"
- add "UTF8::str_split_array()"
- add "UTF8::stripos_in_byte()"
- add "UTF8::emoji_from_country_code()"
- add many new tests
- optimize "UTF8::is_url()" + fix deprecated php (>= 7.3) constants
- optimize "UTF8::str_limit_after_word()" -> optimize the regex
- optimize "UTF8::substr()" -> combine "if"-statements
- optimize "UTF8::str_capitalize_name_helper()" -> performance -> use break
- code style: fix for "UTF8::filter()"
- code style: do not use "=== false" | "=== true" for "bool" types
-
5.4.3814 Jan 2020 -
5.4.3730 Dec 2019 -
5.4.3630 Dec 2019 -
5.4.3527 Dec 2019 -
5.4.3419 Dec 2019 -
5.4.3318 Dec 2019 -
5.4.3213 Dec 2019 -
5.4.3113 Dec 2019 -
5.4.3004 Dec 2019 -
5.4.2902 Dec 2019 -
5.4.2817 Nov 2019Release notes
Open source →- use "mb_str_split" with PHP >= 7.4 + mbstring support (performance++)
- improve performance from "UTF8::string()" (use UTF8::html_entity_decode() for the full string)
- fix errors reported by phpstan (level 7) / psalm
-
5.4.2711 Nov 2019Release notes
Open source →-
"UTF8::clean() / UTF8::cleanup()" -> do not remove invisible urlencoded strings by default
-> problem with e.g. pdf content: "%1b;" -> ...p(CRnAYOD*9a1>VAk^mH%1b;?ZVuX$`P[%...
-
-
5.4.2605 Nov 2019Release notes
Open source →-
disable "Bootup::filterRequestUri()" && "Bootup::filterRequestInputs()" by default
Since version 5.4.26 this library will NOT force "UTF-8" by "bootstrap.php" anymore. If you need to enable this behavior you can define "PORTABLE_UTF8__ENABLE_AUTO_FILTER", before requiring the autoloader. ``` define('PORTABLE_UTF8__ENABLE_AUTO_FILTER', 1); ``` Before version 5.4.26 this behavior was enabled by default and you could disable it via "PORTABLE_UTF8__DISABLE_AUTO_FILTER", but the code had potential security vulnerabilities via injecting code while redirecting via ```header('Location ...```. This is the reason I decided to add this BC in a bug fix release, so that everybody using the current version will receive the security-fix.
-
-
5.4.2514 Oct 2019 -
5.4.2406 Oct 2019Release notes
Open source →- improve performance from "UTF8::UTF8::str_titleize_for_humans()" (use "array_merge" only if needed)
- improve performance from "UTF8::ucwords()" + "UTF8::lcwords()" (don't use "implode()" if it's not needed)
-
5.4.2327 Sep 2019Release notes
Open source →- improve performance from "UTF8::chr_to_decimal()" (now we use iconv if it's available)
- improve performance from "UTF8::html_entity_decode()" (code cleanup, remove dead code)
-
5.4.2226 Sep 2019Release notes
Open source →- improve performance by replacing
count($a) === 0with$a === []-> so we don't need a function call to check if an array is empty
- improve performance by replacing
-
5.4.2117 Sep 2019Release notes
Open source →- improve performance by not using return types for
privatemethods -> the code is already checked via phpstan + psalm + phpstorm, ... so no need to check it every time at runtime at this point
- improve performance by not using return types for
-
5.4.2015 Sep 2019Release notes
Open source →- fix "preg_quote()" usage
- fix return type from "mb_encode_numericentity" & "mb_decode_numeric_entity" usage
- add "@deprecated" for all alias methods
-
5.4.1906 Sep 2019 -
5.4.1821 Aug 2019 -
5.4.1721 Aug 2019Release notes
Open source →- fix "UTF8::get_file_type()" -> do not add too simple comparisons, because of false-positive results
- extend "UTF8::str_titleize()" -> allow to add "word"-chars as new parameter
-
5.4.1615 Aug 2019 -
5.4.1506 Aug 2019Release notes
Open source →- extend "UTF8::range()" -> support for different steps
- fix "UTF8::str_detect_encoding()" detecting of "UTF-32"
- revert: use "mb_detect_order()" for "UTF8::str_detect_encoding()"
-
5.4.1402 Aug 2019 -
5.4.1301 Aug 2019 -
5.4.1231 Jul 2019 -
5.4.1118 Jul 2019Release notes
Open source →- use "mb_detect_order()" for "UTF8::str_detect_encoding()"
- code clean-up + optimize regex usage
-
5.4.1005 Jul 2019 -
5.4.919 Jun 2019Release notes
Open source →- sync with "PHP RFC: Add str begin and end functions"
- fix "UTF8::rawurldecode()" and "UTF8::urldecode()" -> for non multi usage
-
5.4.807 Jun 2019