NewYour coding agent can read the release notes before it upgrades.Set up the MCP server →
Packagist · #1142 most downloaded on Packagist
Portable UTF-8 library - performance optimized (unicode) string functions for php.
Last release 5 months ago
17 Apr 2026
Ships unpredictably
gaps range from 3 weeks to 3.1 years
Nearly every release is documented
notes for 60 of the last 60 stable releases
Nothing withdrawn
no release was ever pulled
12 years old
237 releases · first in 2014
[*]: update the changelog
[*]: update the changelog
PHP 8.5 compatibility: guard ReflectionProperty::setAccessible() / ReflectionMethod::setAccessible() (deprecated since PHP 8.1), replace null array ke…
ReflectionProperty::setAccessible() / ReflectionMethod::setAccessible() (deprecated since PHP 8.1), replace null array keys with empty-string keysfalse return from substr()FOO BAR → fooBar, API2URL → api2Url)mb_regex_encoding() call when PHP is built with --disable-mbregexutf8_decode() truncated-sequence warning and improved handling of invalid/truncated UTF-8 sequencesmbstring encoding settings during bootstrap; added opt-out via PORTABLE_UTF8__DISABLE_AUTO_ENCODINGOne column per quarter.
[*]: update the changelog
[*]: update the changelog
[*]: update phpstan + ignore some false-positiv errors
[*]: update phpstan + ignore some false-positiv errors
[*]: update the changelog
[*]: update the changelog
[*]: update the changelog
[*]: update the changelog
[*]: update the changelog
[*]: update the changelog
[*]: update the changelog
[*]: update the changelog
[*]: update the changelog
[*]: update the changelog
[*]: update the changelog
[*]: update the changelog
PHP 8.2: Fix ${var} string interpolation deprecation | thanks @Ayesh
"To people of Russia": There is a war in Ukraine right now. The forces of the Russian Federation are attacking civilians.
- optimize phpdocs
- update vendor (ASCII) lib
add "UTF8::levenshtein()" | thanks @NewEXE
UTF8::chr_to_int() (please use UTF8::chr_to_decimal())
Removed:
Fixed:
"UTF8::rawurldecode()" -> optimize performance
"UTF8::normalize_whitespace()" -> can now also normalize "control characters" if needed
"UTF8::remove_invisible_characters()" -> can now also remove "control characters" if needed
fix "UTF8::chr()" handling of non "int" code points
optimize performance by re-using the result of "strlen()"
- add "UTF8::str_obfuscate()" - optimize phpdocs
fix UTF8::(l|r)trim | thanks @pmacko
- update vendor (ASCII) lib
fix auto-generate the "API documentation" in the README (via generate_docs.php)
use more template phpdoc-annotation (supported by phpstan and psalm)
fix "UTF8::is_utf8*" -> detecting when last byte is incomplete multibyte character | big thanks @daniel-jeffery
fix php notices (run all tests with E_ALL ^ E_USER_WARNING)
"GRAPHEME_CLUSTER_RX" -> is not used anymore and is now deprecated
- add "UTF8::is_url()"
fix nesting function error from "UTF8::substr()"
add "is_punctuation()" && "is_printable()"
add "UTF8::to_int()" && "UTF8::to_string()"
- use "@psalm-pure"
- use "@psalm-immutable"
fix "UTF8::str_contains_all" -> "strpos(): Empty needle"
- update vendor (ASCII) lib - optimize phpstan config
fix "UTF8::str_contains_all" -> fix the loop
- add "UTF8::has_whitespace()"
use "mb_str_split" with PHP >= 7.4 + mbstring support (performance++)
"UTF8::clean() / UTF8::cleanup()" -> do not remove invisible urlencoded strings by default
"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[%...
…but the code had potential security vulnerabilities via injecting code while redirecting via `header('Location ...`. This is the reason I decided to a…
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.
- update vendor (ASCII) lib
improve performance from "UTF8::UTF8::str_titleize_for_humans()" (use "array_merge" only if needed)
improve performance from "UTF8::chr_to_decimal()" (now we use iconv if it's available)
improve performance by replacing `count($a) === 0 with $a === []` -> so we don't need a function call to check if an array is empty
count($a) === 0 with $a === []
-> so we don't need a function call to check if an array is emptyimprove performance by not using return types for `private` methods -> the code is already checked via phpstan + psalm + phpstorm, ... so no need to c
private methods
-> the code is already checked via phpstan + psalm + phpstorm, ...
so no need to check it every time at runtime at this pointadd "@deprecated" for all alias methods
move ASCII functions into a separated package "Portable ASCII"
optimize "UTF8::str_titleize()" + clean-up
fix "UTF8::get_file_type()" -> do not add too simple comparisons, because of false-positive results
optimize "UTF8::str_detect_encoding()"
extend "UTF8::range()" -> support for different steps
extend "UTF8::range()" -> support for e.g. "a-z" + different encoding
extend "UTF8::wordwrap_per_line()" -> split the input by "$delimiter"
fix "UTF8::wordwrap_per_line()" -> use unicode version of "wordwrap"
use "mb_detect_order()" for "UTF8::str_detect_encoding()"
fix "UTF8::str_contains_any()" -> thanks @drupalista-br
sync with "PHP RFC: Add str begin and end functions"
fix typo in "win1252_to_utf8.php"
Your coding agent can read these notes before it upgrades. Set up the MCP server →