PHPackages                             legacy\_mbstring/mb\_detect\_encoding - 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. legacy\_mbstring/mb\_detect\_encoding

ActivePhp-ext

legacy\_mbstring/mb\_detect\_encoding
=====================================

Old behavior of mbstring(mb\_detect\_encoding) (PHP 8.0)

v0.2.1(1mo ago)10LGPL-2.1-onlyCPHP ^8.1

Since Apr 8Pushed 1mo ago2 watchersCompare

[ Source](https://github.com/youkidearitai/legacy_mbstring)[ Packagist](https://packagist.org/packages/legacy_mbstring/mb_detect_encoding)[ RSS](/packages/legacy-mbstring-mb-detect-encoding/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (3)DependenciesVersions (2)Used By (0)

legacy\_mbstring
================

[](#legacy_mbstring)

PHP 8.0 fallback mbstring functions. However, I hope without using this...

Why legacy\_mbstring?
---------------------

[](#why-legacy_mbstring)

`mb_detect_encoding` is not have backward compatible since PHP 8.1. I'm not have interesting this function's changes behavior, but many PHP users are seems confused.

examples:

- [mb\_detect\_encoding() results for UTF-7 differ between PHP 8.0 and 8.1 (if UTF-7 is present in the encodings list and the string contains '+' character) #10192](https://github.com/php/php-src/issues/10192)
- [mb\_detect\_encoding() detects UTF-8 emoji byte sequence as ISO-8859-1 since PHP 8.1 #7871](https://github.com/php/php-src/issues/7871)

mbstring should to moving forward. However, some PHP users left behind old behavior. This fact is created that motivate it.

Instllation
-----------

[](#instllation)

I recommend using `phpize`.

```
$ git clone https://github.com/youkidearitai/legacy_mbstring
$ cd legacy_mbstring
$ phpize
$ ./configure
$ make
$ make install

```

Functions
---------

[](#functions)

### `legacy_mb_detect_encoding`

[](#legacy_mb_detect_encoding)

Old behavior (&lt;= PHP 8.0) `mb_detect_encoding`

```
legacy_mb_detect_encoding(string $string, array|string|null $encodings = null, bool $strict = false): string|false
```

###  Health Score

35

—

LowBetter than 80% of packages

Maintenance94

Actively maintained with recent releases

Popularity2

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity32

Early-stage or recently created project

 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

32d ago

### Community

Maintainers

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

---

Top Contributors

[![youkidearitai](https://avatars.githubusercontent.com/u/305368?v=4)](https://github.com/youkidearitai "youkidearitai (23 commits)")

### Embed Badge

![Health badge](/badges/legacy-mbstring-mb-detect-encoding/health.svg)

```
[![Health](https://phpackages.com/badges/legacy-mbstring-mb-detect-encoding/health.svg)](https://phpackages.com/packages/legacy-mbstring-mb-detect-encoding)
```

PHPackages © 2026

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