danielstjules / Stringy

A PHP string manipulation library with multibyte support
MIT License
2.46k stars 216 forks source link

No reason for ъ/Ъ/ь/Ь to be in Bulgarian-specific array #190

Open brandonkelly opened 6 years ago

brandonkelly commented 6 years ago

Stringy::langSpecificCharsArray() defines ASCII counterparts for the following Bulgarian characters: ъ, Ъ, ь, and Ь

However none of those characters have any alternatives in Stringy::charsArray(), which means they will be untouched by Stringy::toAscii() unless $language is set to 'bg'.

As there are no other ASCII equivalents for these characters, I think they should be defined in charsArray() instead.

echo Stringy::create('ъ')->toAscii();
// outputs: 'ъ'
// expected: 'a'

echo Stringy::create('ъ')->toAscii('bg');
// outputs: 'a' (as expected)