PHPackages                             descom/file\_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. [Utility &amp; Helpers](/categories/utility)
4. /
5. descom/file\_encoding

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

descom/file\_encoding
=====================

PHP class to encode files

1.0.1(8y ago)11412[1 PRs](https://github.com/descom-es/php-file-encoding/pulls)MITPHPPHP ^5.6 || ^7.0

Since Jan 30Pushed 8y ago2 watchersCompare

[ Source](https://github.com/descom-es/php-file-encoding)[ Packagist](https://packagist.org/packages/descom/file_encoding)[ Docs](https://www.descom.es)[ RSS](/packages/descom-file-encoding/feed)WikiDiscussions 1.0 Synced 3d ago

READMEChangelog (2)Dependencies (1)Versions (4)Used By (0)

[![StyleCI](https://camo.githubusercontent.com/e10403387091ce763128861b6d4db1bcc9b42920994d90e5fa7b6c008fb3a890/68747470733a2f2f7374796c6563692e696f2f7265706f732f3131393339373033362f736869656c64)](https://styleci.io/repos/119397036)[![Build Status](https://camo.githubusercontent.com/79b61b3a2a3504a20ef430f3c90a88cf23914fc18cac7dacd305ef92c25f5c08/68747470733a2f2f7472617669732d63692e6f72672f646573636f6d2d65732f7068702d66696c652d656e636f64696e672e7376673f6272616e63683d312e30)](https://travis-ci.org/descom-es/php-file-encoding)

PHP convert files encoding
==========================

[](#php-convert-files-encoding)

PHP class to convert files encoding

Installation
------------

[](#installation)

You can install it with composer:

```
composer require descom/file_encoding
```

Usage
-----

[](#usage)

```
encodeFile($file, $encoding_to, $encodings_detected);
```

This is an example:

```
use Descom\File\Encoding;

$codification = new Encoding();

$file = 'file.txt';
$encoding_to = 'UTF-8';
$encodings_detected = 'UTF-8,ISO-8859-1,WINDOWS-1252';

$result = $codification->encodeFile($file, $encoding_to, $encodings_detected);
```

Encoding values
---------------

[](#encoding-values)

### Allowed encodings

[](#allowed-encodings)

### Default values

[](#default-values)

```
$encoding_to = 'UTF-8';
$encodings_detected = 'UTF-8,ISO-8859-1,WINDOWS-1252';
```

###  Health Score

29

—

LowBetter than 59% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity13

Limited adoption so far

Community13

Small or concentrated contributor base

Maturity60

Established project with proven stability

 Bus Factor1

Top contributor holds 56.7% 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

Every ~0 days

Total

3

Last Release

3027d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/4b55eee54720c049e8270abcff6e8f0d9412aedc136b0228bf45ca3f7aaea6df?d=identicon)[cesargb](/maintainers/cesargb)

![](https://www.gravatar.com/avatar/86e19cbb9d727adc8ed5d189c3cb72e364708c730b5d5469f6ecee7d5393fa89?d=identicon)[descom](/maintainers/descom)

---

Top Contributors

[![llorensjj](https://avatars.githubusercontent.com/u/7073372?v=4)](https://github.com/llorensjj "llorensjj (17 commits)")[![cesargb](https://avatars.githubusercontent.com/u/25681494?v=4)](https://github.com/cesargb "cesargb (13 commits)")

---

Tags

encodefilephpphputf-8encodingencodeISO-8859-1convert file encoding

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/descom-file-encoding/health.svg)

```
[![Health](https://phpackages.com/badges/descom-file-encoding/health.svg)](https://phpackages.com/packages/descom-file-encoding)
```

###  Alternatives

[voku/portable-utf8

Portable UTF-8 library - performance optimized (unicode) string functions for php.

52322.4M40](/packages/voku-portable-utf8)[onnov/detect-encoding

Text encoding definition class instead of mb\_detect\_encoding. Defines: utf-8, windows-1251, koi8-r, iso-8859-5, ibm866, .....

223.8M8](/packages/onnov-detect-encoding)[ddeboer/transcoder

Better encoding conversion for PHP

16705.6k10](/packages/ddeboer-transcoder)[delight-im/base64

Simple and convenient Base64 encoding and decoding for PHP

15158.1k6](/packages/delight-im-base64)[anisimov/emoji

Allows to detect emoji, remove emoji, encode emoji and decode emoji in string.

103.7k](/packages/anisimov-emoji)

PHPackages © 2026

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