PHPackages                             saparot/encoder - 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. saparot/encoder

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

saparot/encoder
===============

string and array encoding converter

v1.0.0(7y ago)011MITPHPPHP &gt;=7.0

Since Apr 8Pushed 5y agoCompare

[ Source](https://github.com/saparot/encoder)[ Packagist](https://packagist.org/packages/saparot/encoder)[ Docs](https://github.com/saparot/php-encoder)[ RSS](/packages/saparot-encoder/feed)WikiDiscussions master Synced 3d ago

READMEChangelogDependencies (1)Versions (2)Used By (0)

saparot encoder!
================

[](#saparot-encoder)

Description
-----------

[](#description)

saparot encoder **helps** you to **convert strings and arrays** between various encodings. Main intention of that set small lib was to make it possible to **upgrade a latin-1 based running site into UTF-8**.

License
-------

[](#license)

Copyright (c) **2019** ****

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE..

Converting
----------

[](#converting)

This library does not convert itself, but handles exceptions between various LATIN-1 encodings like ISO-8859-1, WINDOWS-1252, ISO-8859-15. Convert is done by **mb-functions**

Features
--------

[](#features)

- Detection to find best matching encoding for a string
- Debug mode
- Deep Convert of Arrays, including keys (optional)

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

[](#requirements)

- php &gt;= 7
- ext-mbstring

Installation via Composer
-------------------------

[](#installation-via-composer)

`composer require saparot/encoder`

> get composer:

Basics
------

[](#basics)

### detect encoding of a string

[](#detect-encoding-of-a-string)

```
$languageGroup = Encoder\Encoder::ENC_GROUP_LATIN;
try {
	$e = new Encoder\Encoder();
	$detectedEncoding = $e->detect($yourString);
} catch (Encoder\Exception $e) {
	//ups.
}

```

### convert a string to UTF-8

[](#convert-a-string-to-utf-8)

```
$languageGroup = Encoder\Encoder::ENC_GROUP_LATIN;
try {
	$e = new Encoder\Encoder();
	$convertedString = $e->convertString($yourString);
} catch (Encoder\Exception $e) {
	//ups.
}

```

### convert a array to UTF-8

[](#convert-a-array-to-utf-8)

```
$languageGroup = Encoder\Encoder::ENC_GROUP_LATIN;
try {
	$e = new Encoder\Encoder();
	$convertedArray = $e->convertArray($yourString);
} catch (Encoder\Exception $e) {
	//ups.
}

```

###  Health Score

23

—

LowBetter than 27% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity5

Limited adoption so far

Community2

Small or concentrated contributor base

Maturity54

Maturing project, gaining track record

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

2594d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/4041b99d1d8fc10f96a237738487033b285898466ee896441bd7fd22f2805e56?d=identicon)[saparot](/maintainers/saparot)

---

Tags

convertutf8encodingmultibytembconverterlatin1

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/saparot-encoder/health.svg)

```
[![Health](https://phpackages.com/badges/saparot-encoder/health.svg)](https://phpackages.com/packages/saparot-encoder)
```

###  Alternatives

[paragonie/constant_time_encoding

Constant-time Implementations of RFC 4648 Encoding (Base-64, Base-32, Base-16)

901329.7M148](/packages/paragonie-constant-time-encoding)[iamcal/php-emoji

This is a PHP library for dealing with Emoji, allowing you to convert between various native formats and displaying them using HTML.

1.3k481.1k](/packages/iamcal-php-emoji)[zbateson/mb-wrapper

Wrapper for mbstring with fallback to iconv for encoding conversion and string manipulation

4948.6M5](/packages/zbateson-mb-wrapper)[ddeboer/transcoder

Better encoding conversion for PHP

16705.6k10](/packages/ddeboer-transcoder)[matthiasmullie/path-converter

Relative path converter

10229.6M7](/packages/matthiasmullie-path-converter)

PHPackages © 2026

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