PHPackages                             rb28dett/php-utf-8 - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Localization &amp; i18n](/categories/localization)
4. /
5. rb28dett/php-utf-8

ActiveLibrary[Localization &amp; i18n](/categories/localization)

rb28dett/php-utf-8
==================

A library for UTF-8 in PHP providing UTF-8 aware functions to mirror PHP's own string functions. The library doesn't require PHP mbstring extension although, if found, it will use it to gain performance.

1.0.0(6y ago)117[1 PRs](https://github.com/amxx-bg/php-utf-8/pulls)LGPL-2.1PHPPHP &gt;=5.4.0CI failing

Since Jul 18Pushed 4y ago1 watchersCompare

[ Source](https://github.com/amxx-bg/php-utf-8)[ Packagist](https://packagist.org/packages/rb28dett/php-utf-8)[ Docs](https://github.com/rb28dett/php-utf-8)[ RSS](/packages/rb28dett-php-utf-8/feed)WikiDiscussions master Synced 2mo ago

READMEChangelog (2)Dependencies (3)Versions (3)Used By (0)

[![PHPCI](https://camo.githubusercontent.com/b2e1c4201e83eba695f76249a66c11352bd6295f372cc3c597a649331a0f0306/687474703a2f2f70687063692e636f72707365652e636f6d2f6275696c642d7374617475732f696d6167652f323f6272616e63683d6d6173746572266c6162656c3d5048504349267374796c653d666c61742d737175617265)](http://phpci.corpsee.com/build-status/view/2?branch=master)[![Travis](https://camo.githubusercontent.com/e078493ef24f3a2f8485abcfd58bb0747c0d17c7fdee0aabb6d9310cd2af3caf/68747470733a2f2f696d672e736869656c64732e696f2f7472617669732f636f72707365652f7068702d7574662d382f6d61737465722e7376673f6c6162656c3d547261766973267374796c653d666c61742d737175617265)](https://travis-ci.org/corpsee/php-utf-8?branch=master)[![Latest Version](https://camo.githubusercontent.com/238415f30ef66136b24be279dbdb3ff9aa6770a7a979baaff16b24278ee5d235/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f636f72707365652f7068702d7574662d382e7376673f6c6162656c3d56657273696f6e267374796c653d666c61742d737175617265)](https://packagist.org/packages/corpsee/php-utf-8)[![Total downloads](https://camo.githubusercontent.com/9ae2a0934cda20e8329fb7edb340e00517f808096e45d4cfdf4d71100f852895/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f636f72707365652f7068702d7574662d382e7376673f6c6162656c3d446f776e6c6f616473267374796c653d666c61742d737175617265)](https://packagist.org/packages/corpsee/php-utf-8)[![License](https://camo.githubusercontent.com/e2aaba967ac0bddb0af2393bb6f798c7152bc197950d5196d468ab47cee182e0/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f636f72707365652f7068702d7574662d382e7376673f6c6162656c3d4c6963656e7365267374796c653d666c61742d737175617265)](https://packagist.org/packages/corpsee/php-utf-8)[![SensioLabs Insight](https://camo.githubusercontent.com/63a618738d0c7eb6dceca1cc207d12d03ddc89a5e9883d1143ed1b7daffbd77d/68747470733a2f2f696d672e736869656c64732e696f2f73656e73696f6c6162732f692f66333438666636612d343065392d343235392d616631662d6538386635663963353838642e7376673f6c6162656c3d496e7369676874267374796c653d666c61742d737175617265)](https://insight.sensiolabs.com/projects/f348ff6a-40e9-4259-af1f-e88f5f9c588d)

PHP-UTF-8
=========

[](#php-utf-8)

This is fork of the [FSX/php-utf8](https://github.com/FSX/php-utf8) library. It was created because the author of origin library doesn`t support it.

php-utf8 is a UTF-8 aware library of functions mirroring PHP's own string functions. Does not require PHP mbstring extension though will use it, if found, for a (small) performance gain.

The project was initially on sourceforge where it died due to lack of development and support. This project has been forked and moved to github.com so that many more people can actually contribute with more ease.

Use the [issue tracker](https://github.com/corpsee/php-utf-8/issues) here on github.com, to post about problems and feature requests.

Please feel free to fork and get back to us with fork requests for optimizations and new features.

Documentation &amp; Usage Information
-------------------------------------

[](#documentation--usage-information)

Using the php-utf-8 library is quite easy. Just include the `php-utf8.php` and any additional functions that you may need from the `functions` folder.

Sample Code:

```
// get the core functions included ...
require('php-utf8_path/php-utf8.php');

// ... and any other functions/*.php or utils/*.php files you may need.
require('php-utf8_path/functions/trim.php');
```

Make sure that you are confident about using the library by reading [Character Sets / Character Encoding Issues](http://www.phpwact.org/php/i18n/charsets) and [Handling UTF-8 with PHP](http://www.phpwact.org/php/i18n/utf-8).

Use these functions **only** if you really need them &amp; you understand **why**you need to use them.

In particular, do not blindly replace all use of PHP's string functions which functions found here. Most of the time you will not need to, and you will be introducing a significant performance overhead to your application.

Most of the functions here are not operating *defensively*, mainly for performance reasons. For example there is no extensive parameter checking and it is assumed that they are fed with well formed UTF-8. This is particularly relevant when is comes to catching badly formed UTF-8. You should screen input on the *outer perimeter*with help from functions in the `utils/validation.php` and `utils/bad.php` files.

Throughout the library **all** ASCII characters (*control characters included*) are treated as valid throughout the library. Make sure you take the appropriate measures before outputting into XML since it can become ill-formed with some control characters. [more info](http://hsivonen.iki.fi/producing-xml/#controlchar)

Licensing
---------

[](#licensing)

The initial code of php-utf-8 is published under LGPL. Please find a copy of the license in the LICENSE file.

Parts of the code in this library come from other places, under different licenses. The authors involved have been contacted (see below). Attribution for which code came from elsewhere can be found in the source code itself.

- Andreas Gohr / Chris Smith of Dokuwiki. *There is a fair degree of collaboration/exchange of ideas and code between [Dokuwiki's UTF-8 library](http://dev.splitbrain.org/view/darcs/dokuwiki/inc/utf8.php) and phputf8. Although Dokuwiki is released under GPL, its UTF-8 library is released under LGPL, hence no conflict with phputf8*
- Henri Sivonen ([site](http://hsivonen.iki.fi/php-utf8/)) *has also given permission for his code to be released under the terms of the LGPL. He ported a Unicode / UTF-8 converter from the Mozilla codebase to PHP, which is re-used in php-utf-8.*

###  Health Score

25

—

LowBetter than 37% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity7

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity55

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

2492d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/bf96bca314819b3d58dd32cb8f96b9f606793ce7eacbf662b9f2fb3bce36c335?d=identicon)[stfkolev](/maintainers/stfkolev)

---

Top Contributors

[![stfkolev](https://avatars.githubusercontent.com/u/42889703?v=4)](https://github.com/stfkolev "stfkolev (1 commits)")

---

Tags

phps9eutf8utf-8i18nutf8unicode

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/rb28dett-php-utf-8/health.svg)

```
[![Health](https://phpackages.com/badges/rb28dett-php-utf-8/health.svg)](https://phpackages.com/packages/rb28dett-php-utf-8)
```

###  Alternatives

[symfony/string

Provides an object-oriented API to strings and deals with bytes, UTF-8 code points and grapheme clusters in a unified way

1.8k724.1M827](/packages/symfony-string)[symfony/intl

Provides access to the localization data of the ICU library

2.6k199.8M1.1k](/packages/symfony-intl)[voku/portable-utf8

Portable UTF-8 library - performance optimized (unicode) string functions for php.

52322.4M40](/packages/voku-portable-utf8)[gettext/gettext

PHP gettext manager

70530.2M102](/packages/gettext-gettext)[gettext/languages

gettext languages with plural rules

7530.3M11](/packages/gettext-languages)[punic/punic

PHP-Unicode CLDR

1542.9M29](/packages/punic-punic)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
