PHPackages                             tecnickcom/tc-lib-unicode - 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. [PDF &amp; Document Generation](/categories/documents)
4. /
5. tecnickcom/tc-lib-unicode

ActiveLibrary[PDF &amp; Document Generation](/categories/documents)

tecnickcom/tc-lib-unicode
=========================

PHP library containing Unicode methods

2.10.1(1w ago)10742.3k↓11.1%8[3 issues](https://github.com/tecnickcom/tc-lib-unicode/issues)[1 PRs](https://github.com/tecnickcom/tc-lib-unicode/pulls)2LGPL-3.0-or-laterPHPPHP &gt;=8.2CI passing

Since Aug 8Pushed 2w ago2 watchersCompare

[ Source](https://github.com/tecnickcom/tc-lib-unicode)[ Packagist](https://packagist.org/packages/tecnickcom/tc-lib-unicode)[ Docs](https://tcpdf.org)[ GitHub Sponsors](https://github.com/sponsors/tecnickcom)[ RSS](/packages/tecnickcom-tc-lib-unicode/feed)WikiDiscussions main Synced yesterday

READMEChangelogDependencies (13)Versions (122)Used By (2)

tc-lib-unicode
==============

[](#tc-lib-unicode)

> UTF-8 and Unicode processing utilities, including bidirectional text handling.

[![Latest Stable Version](https://camo.githubusercontent.com/05ca1d1721b04e8aac006bb1f93854099187ce9f20f7157baec9c6202c0c07ed/68747470733a2f2f706f7365722e707567782e6f72672f7465636e69636b636f6d2f74632d6c69622d756e69636f64652f76657273696f6e)](https://packagist.org/packages/tecnickcom/tc-lib-unicode)[![Build](https://github.com/tecnickcom/tc-lib-unicode/actions/workflows/check.yml/badge.svg)](https://github.com/tecnickcom/tc-lib-unicode/actions/workflows/check.yml)[![Coverage](https://camo.githubusercontent.com/14d577e698e4f7968216afe5ffa4d621e7b446f3b9e9580a434fa16561960a63/68747470733a2f2f636f6465636f762e696f2f67682f7465636e69636b636f6d2f74632d6c69622d756e69636f64652f67726170682f62616467652e7376673f746f6b656e3d584c4d30515759394245)](https://codecov.io/gh/tecnickcom/tc-lib-unicode)[![License](https://camo.githubusercontent.com/10f1818952b9e887f80745b03fe231f724cac4bc4c59fe9a52c733c1d806c399/68747470733a2f2f706f7365722e707567782e6f72672f7465636e69636b636f6d2f74632d6c69622d756e69636f64652f6c6963656e7365)](https://packagist.org/packages/tecnickcom/tc-lib-unicode)[![Downloads](https://camo.githubusercontent.com/a90381d561e7e6cdadda47ca7f7b8d98b4e6d85489b985d066a7aa862316e208/68747470733a2f2f706f7365722e707567782e6f72672f7465636e69636b636f6d2f74632d6c69622d756e69636f64652f646f776e6c6f616473)](https://packagist.org/packages/tecnickcom/tc-lib-unicode)

[![Sponsor on GitHub](https://camo.githubusercontent.com/dd89cb32d6e7ff9dbb0fa7ce84923567358b220feb9198b3720beabc3153da6a/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f73706f6e736f722d6769746875622d4541344141412e7376673f6c6f676f3d67697468756273706f6e736f7273266c6f676f436f6c6f723d7768697465)](https://github.com/sponsors/tecnickcom)

> 💖 Part of the [tc-lib-pdf / TCPDF](https://github.com/tecnickcom/tc-lib-pdf) ecosystem (100M+ installs). [Sponsor its maintenance →](https://github.com/sponsors/tecnickcom)

---

Overview
--------

[](#overview)

`tc-lib-unicode` provides Unicode conversion helpers and bidirectional algorithm support for robust multilingual text processing.

It is built to handle multilingual text paths where normalization, code-point handling, and bidirectional ordering directly affect rendering quality. By isolating Unicode-heavy operations, dependent libraries can keep text processing accurate and easier to audit.

**Namespace**`\Com\Tecnick\Unicode`**Author**Nicola Asuni **License**[GNU LGPL v3](https://www.gnu.org/copyleft/lesser.html) - see [LICENSE](LICENSE)**API docs****Packagist**---

Features
--------

[](#features)

### Unicode Utilities

[](#unicode-utilities)

- UTF-8 character and ordinal conversion helpers
- String/character array transformations
- Integration-ready conversion methods for document engines

### Bidirectional Support

[](#bidirectional-support)

- Unicode Bidirectional Algorithm implementation
- Right-to-left and mixed-direction text processing
- Supporting shaping/step logic for complex scripts

### Character Substitution

[](#character-substitution)

- Context-sensitive codepoint-level substitution via `Substitution::replaceChars()`
- **Thai** — repositions leading vowels (Sara E/AE/O/AI, U+0E40–U+0E44, U+0E4D) to follow their base consonant, matching PDF visual-order glyph streams
- **Devanagari** — moves left-positional matras (U+093F) to precede their base consonant cluster, including conjuncts joined by Virama (U+094D)
- **Hangul** — composes Hangul Jamo sequences (U+1100–U+11FF, U+A960–U+A97F, U+D7B0–U+D7FF) into precomposed syllables (U+AC00–U+D7A3) per Unicode Standard §3.12

---

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

[](#requirements)

- PHP 8.2 or later
- Extensions: `mbstring`, `pcre`
- Composer

---

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

[](#installation)

```
composer require tecnickcom/tc-lib-unicode
```

---

Quick Start
-----------

[](#quick-start)

```
