PHPackages                             wrossmann/utf8\_escape - 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. [Utility &amp; Helpers](/categories/utility)
4. /
5. wrossmann/utf8\_escape

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

wrossmann/utf8\_escape
======================

1.0.0(7y ago)081PHPPHP &gt;= 5.4

Since Mar 30Pushed 7y ago1 watchersCompare

[ Source](https://github.com/wrossmann/php_utf8_escape)[ Packagist](https://packagist.org/packages/wrossmann/utf8_escape)[ RSS](/packages/wrossmann-utf8-escape/feed)WikiDiscussions master Synced today

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

utf8\_escape
============

[](#utf8_escape)

Escape a UTF-8 string with the `\u1234` format.

Requirements
------------

[](#requirements)

- PHP &gt;= 5.4

However, ***you should not be using EOL versions like this.*** I added Symfony's mb\_polyfill to support PHP &lt; 7.2 which had the side effect of making it work as far back as 5.4

Installation
------------

[](#installation)

```
composer require wrossmann\utf8_escape

```

Usage
-----

[](#usage)

```
$escaped = utf8_escape($string);

```

Component functions are `public static` and defined in `src/Escaper.php`.

Caveats
-------

[](#caveats)

This library does not strictly enforce that the input be well-formed UTF8 text and may misbehave if fed anything else.

As always *you* are responsible for ensuring that input you've received is encoded the way you expecct it, and to *explicitly* convert between source and destination encodings. Eg:

```
mb_convert_encoding($input, 'UTF-8', 'ISO-8859-1')

```

`utf8_encode()` and `utf8_decode()` are not magic wands and will happily break your data. Never use them.

Suggested reading
-----------------

[](#suggested-reading)

-

###  Health Score

24

—

LowBetter than 32% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity5

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity54

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

2599d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/07eeb654c6e5293a620e4eb42138f331bc966fe0c26e54b7581aee28ee5c03c7?d=identicon)[wrossmann](/maintainers/wrossmann)

---

Top Contributors

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

### Embed Badge

![Health badge](/badges/wrossmann-utf8-escape/health.svg)

```
[![Health](https://phpackages.com/badges/wrossmann-utf8-escape/health.svg)](https://phpackages.com/packages/wrossmann-utf8-escape)
```

###  Alternatives

[vlucas/phpdotenv

Loads environment variables from `.env` to `getenv()`, `$\_ENV` and `$\_SERVER` automagically.

13.5k602.4M5.4k](/packages/vlucas-phpdotenv)[symfony/filesystem

Provides basic utilities for the filesystem

4.6k669.1M3.2k](/packages/symfony-filesystem)[friendsofphp/php-cs-fixer

A tool to automatically fix PHP code style

13.5k234.7M20.6k](/packages/friendsofphp-php-cs-fixer)[danielstjules/stringy

A string manipulation library with multibyte support

2.4k26.0M191](/packages/danielstjules-stringy)[rubix/ml

A high-level machine learning and deep learning library for the PHP language.

2.2k1.4M28](/packages/rubix-ml)[voku/portable-utf8

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

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

PHPackages © 2026

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