cline/babel

Unicode-aware string encoding, conversion, and analysis library for PHP

Maintainers

👁 faustbrian

Package info

github.com/faustbrian/babel

pkg:composer/cline/babel

Statistics

Installs: 3 659

Dependents: 0

Suggesters: 0

Stars: 0

Open Issues: 0

2.1.2 2026-03-18 16:45 UTC

Requires

Requires (Dev)

Suggests

None

Provides

None

Conflicts

None

Replaces

None

MIT a22bbd5a99ef29f591dcab967d471dafbd3162f6

  • Brian Faust <brian.woop@cline.sh>

phpi18nutf8transliterationencodingstringasciiunicode

This package is auto-updated.

Last update: 2026-06-18 17:20:52 UTC


README

👁 GitHub Workflow Status
👁 Latest Version on Packagist
👁 Software License
👁 Total Downloads

Unicode-aware string encoding, conversion, and analysis for PHP with a fluent API. Features script detection, directionality analysis, character analysis, and intelligent transliteration.

Requirements

Requires PHP 8.2+ with ext-intl, ext-mbstring, and ext-iconv

Installation

composer require cline/babel

Documentation

Quick Examples

use Cline\Babel\Babel;

// Convert to ASCII with transliteration
Babel::from('Żółć')->toAscii(); // "Zolc"
Babel::from('北京')->toAscii(); // "bei jing"
Babel::from('Привет')->toAscii(); // "Privet"

// Detect scripts
Babel::from('Hello 世界')->containsChinese(); // true
Babel::from('Привет мир')->containsCyrillic(); // true
Babel::from('مرحبا')->isRtl(); // true

// Clean strings
Babel::from("Hello\x00World")->removeNonPrintable()->value(); // "HelloWorld"
Babel::from('Hello 👋')->removeEmoji()->value(); // "Hello "

// Create slugs
Babel::from('Héllo Wörld!')->toSlug(); // "hello-world"

Change log

Please see CHANGELOG for more information on what has changed recently.

Contributing

Please see CONTRIBUTING and CODE_OF_CONDUCT for details.

Security

If you discover any security related issues, please use the GitHub security reporting form rather than the issue queue.

Credits

License

The MIT License. Please see License File for more information.