# neitanod/forceutf8

PHP Class Encoding featuring popular Encoding::toUTF8() function --formerly known as forceUTF8()-- that fixes mixed encoded strings.

Repository: https://github.com/neitanod/forceutf8
Canonical: https://ross.abutalabs.com/products/forceutf8
Language: PHP
License Family: other
Last push: 2023-06-19T18:08:07+00:00

## Health v2 (maintenance only)
Score: 23/100 (v2, computed 2026-09-03T02:20:16.233290+00:00)
- activity 0, release rhythm 8, longevity 100
- inputs: {"age_days": 4969, "days_push": 1171, "days_rel": null, "gap_med": null, "n_releases_24m": 0}
- flags: no_license
- formula: round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10)

## Adoption (not part of the score)
Stars 1633, forks 358 (observed 2026-08-28T04:05:14.265876+00:00)

## What it is
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
- artifact type: library
- maturity: active
- function: serialization, parser, developer-tools
- domain: developer-tools, web-development
- platform: php
- tags: encoding, utf8, character-encoding, string-manipulation, text-processing, encoding-detection, latin1, windows-1252, mojibake, data-cleaning, natural-language-processing

## Member repositories
- neitanod/forceutf8 (main) score 23

## Provenance
- Observed fields: from GitHub, fetched 2026-08-28T04:05:14.265876+00:00.
- Health v2: computed from the inputs above; adoption is never an input.
- Inferred fields (summary, facets, guidance): AI-extracted, prompt v1, taxonomy v1, on 2026-08-30T03:47:20.973320+00:00, confidence not recorded.
  - readme: https://github.com/neitanod/forceutf8 (fetched 2026-08-28T04:05:14.265876+00:00, sha 765483eeb8fe)
- Data as of 2026-08-30T08:39:29.467469+00:00.
