PHPackages                             tomwilford/php-utf8-to-rtf - 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. [Parsing &amp; Serialization](/categories/parsing)
4. /
5. tomwilford/php-utf8-to-rtf

ActiveLibrary[Parsing &amp; Serialization](/categories/parsing)

tomwilford/php-utf8-to-rtf
==========================

A simple package to convert UTF8 characters to RTF

v1.1.0(3y ago)09.7k—7.1%BSD-3-ClausePHP

Since Jan 1Pushed 3y ago1 watchersCompare

[ Source](https://github.com/TomWilford/php-utf8-to-rtf)[ Packagist](https://packagist.org/packages/tomwilford/php-utf8-to-rtf)[ Docs](https://jollyblueman.com)[ RSS](/packages/tomwilford-php-utf8-to-rtf/feed)WikiDiscussions main Synced 2d ago

READMEChangelog (2)Dependencies (2)Versions (3)Used By (0)

PHP UTF8 To RTF
===============

[](#php-utf8-to-rtf)

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

[](#description)

A simple PHP class for converting UTF8 characters to an RTF safe version in a string.

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

[](#installation)

`composer require tomwilford/php-utf8-to-rtf`

Usage
-----

[](#usage)

> Requires PHP 7.0 or higher

Instantiate the converter using:

```
$converter = new CharacterConverter();
```

To find and replace UTF8 characters with RTF safe versions in a long string use:

```
$convertedString = $converter->findAndReplace($string);
```

Or, for shorter strings and characters, simply convert the whole string:

```
$convertedString = $converter->convertStringToRtf($string);
```

You can also convert an array of UTF8 strings:

```
$convertedArray = $converter->convertArrayToRtf($arrayOfStrings);
```

Finally, if you need to do any additional processing on the UTF8 characters before converting, you can extract them as an array using:

```
$arrayToConvert = $converter->locateCharactersInString($string);
```

Testing
-------

[](#testing)

PHPUnit tests have been written using series of pangrams sourced online to try to best capture as many characters as possible in different languages being used in a natural way. Please see the [Pangrams trait](tests/Resources/Pangrams.php) for the pangram sources' credits.

There also is a short script that can [generate a test RTF file](tests/GenerateTestFile/generateTestFile.php) that can be opened in a word processor to verify the results.

Contributing
------------

[](#contributing)

Contributions are welcome, please see [CONTRIBUTING](CONTRIBUTING.md) for more information.

Software License
----------------

[](#software-license)

Copyright (c) 2022. Tom Wilford All rights reserved.

This source code is licensed under the BSD-style license found in the LICENSE file in the root directory of this source tree.

###  Health Score

27

—

LowBetter than 47% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity23

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity47

Maturing project, gaining track record

 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

Every ~0 days

Total

2

Last Release

1279d ago

### Community

Maintainers

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

---

Top Contributors

[![TomWilford](https://avatars.githubusercontent.com/u/28453594?v=4)](https://github.com/TomWilford "TomWilford (35 commits)")

###  Code Quality

TestsPHPUnit

Code StylePHP\_CodeSniffer

### Embed Badge

![Health badge](/badges/tomwilford-php-utf8-to-rtf/health.svg)

```
[![Health](https://phpackages.com/badges/tomwilford-php-utf8-to-rtf/health.svg)](https://phpackages.com/packages/tomwilford-php-utf8-to-rtf)
```

###  Alternatives

[mck89/peast

Peast is PHP library that generates AST for JavaScript code

19139.2M47](/packages/mck89-peast)[sauladam/shipment-tracker

Parses tracking information for several carriers, like UPS, USPS, DHL and GLS by simply scraping the data. No need for any kind of API access.

9843.5k](/packages/sauladam-shipment-tracker)[jstewmc/rtf

Read and write Rich Text Format (RTF) documents with PHP

45153.1k6](/packages/jstewmc-rtf)[tcds-io/php-jackson

A lightweight, flexible object serializer for PHP, inspired by FasterXML/jackson

113.2k10](/packages/tcds-io-php-jackson)

PHPackages © 2026

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