neitanod/forceutf8
PHP Class Encoding featuring popular Encoding::toUTF8() function --formerly known as forceUTF8()-- that fixes mixed encoded strings. observed · 2026-08-28
Health v2 · maintenance only
23/100
- Activity 0
- Release rhythm 8
- Longevity 100
Flags: no_license
How is this computed?
round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10) — computed 2026-09-03. Adoption (stars, forks) is never an input.
- gap_med: n/a
- age_days: 4969
- days_rel: n/a
- days_push: 1171
- n_releases_24m: 0
Adoption not part of the score
1633 stars · 358 forks observed · 2026-08-28
What it is AI-extracted, prompt v1, taxonomy v1, 2026-08-30, confidence not recorded
A PHP library providing static Encoding class methods (toUTF8, fixUTF8, toLatin1) that convert strings of unknown or mixed encoding—Latin1, Windows-1252, UTF-8, or combinations—into clean UTF-8. It also repairs double- or multiply-encoded (garbled/mojibake) UTF-8 strings, with optional iconv flags for transliteration or character dropping.
Use cases
- fix garbled utf8 strings in php
- convert latin1 or windows-1252 strings to utf8
- repair double-encoded utf8 text
- clean mixed encoding from unreliable data sources
- normalize string encoding before storing in database
- fix mojibake like Fédération to Fédération
- handle mixed utf8 and latin1 in the same string
When to choose
- you have PHP strings with unknown or mixed encodings (Latin1, Windows-1252, UTF-8) that need to be normalized to UTF-8
- you need to repair double- or multiply-encoded UTF-8 (mojibake) without knowing how many times it was encoded
- you're ingesting data from unreliable sources like legacy databases, scrapes, or third-party APIs with inconsistent encoding
- you want a simple static-method API with no dependencies beyond optional iconv
When to avoid
- you need full character-set detection beyond Latin1/Windows-1252/UTF-8 (consider mb_detect_encoding or a dedicated detection library)
- you're not working in PHP
- you need streaming or very large text processing with performance-critical encoding conversion
- you need transliteration to ASCII or locale-aware case folding
Facets
library · maturity active
serialization parser developer-tools developer-tools web-development php encoding utf8 character-encoding string-manipulation text-processing encoding-detection latin1 windows-1252 mojibake data-cleaning natural-language-processing
1 source
- readme: https://github.com/neitanod/forceutf8 · fetched 2026-08-28 · 765483eeb8fe
Member repositories
| Repository | Role | Health v2 |
|---|---|---|
| neitanod/forceutf8 | main | 23 |
For agents
markdown · JSON · MCP: product_card(name="neitanod/forceutf8")
Data as of 2026-08-30T08:39:29.467469+00:00 · Report a problem