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 2w ago

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 31% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity5

Limited adoption so far

Community8

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

2648d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/4967671?v=4)[Wade Rossmann](/maintainers/wrossmann)[@wrossmann](https://github.com/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

[symfony/filesystem

Provides basic utilities for the filesystem

4.6k696.0M3.8k](/packages/symfony-filesystem)[symfony/dom-crawler

Eases DOM navigation for HTML and XML documents

4.0k392.6M2.5k](/packages/symfony-dom-crawler)[friendsofphp/php-cs-fixer

A tool to automatically fix PHP code style

13.5k245.4M24.0k](/packages/friendsofphp-php-cs-fixer)[symfony/console

Eases the creation of beautiful and testable command line interfaces

9.8k1.1B13.2k](/packages/symfony-console)[symfony/symfony

The Symfony PHP framework

31.4k86.9M2.2k](/packages/symfony-symfony)[symfony/http-foundation

Defines an object-oriented layer for the HTTP specification

8.6k910.8M6.2k](/packages/symfony-http-foundation)

PHPackages © 2026

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