PHP: Transliterator (polyfill)

PHP: Transliterator (polyfill)

voku

Member
Local time
09:44
Joined
Oct 9, 2019
Messages
4

Hi, since some evenings I try to polyfill the "Transliterator"-class from php, so that we can convert text in e.g. ASCII more easily.

code: voku/polyfill (src/Intl/Transliterator/Transliterator.php)
test: tests/Intl/Transliterator/TransliteratorTest.php
demo: https://unicode.org/cldr/utility/transform.jsp

If someone are interested in over-complicated syntax and strange characters, please add some more test cases into "TransliteratorTest.php".

 

Gummibeer

Astroneer
Moderator
Local time
09:44
Joined
Oct 5, 2019
Messages
1,161
Pronouns
he/him

The third class line is the reason why I learned hating Symfony. 😅 And nearly all together. 🙈

private the package maintainer isn't the one to decide what the user possibly needs or wants to change.
array() instead of []. It's not even more readable.

 
Top