Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Turn this package into a polyfill for transliterator_transliterate() #32

Open
nicolas-grekas opened this issue Sep 16, 2019 · 2 comments

Comments

@nicolas-grekas
Copy link

nicolas-grekas commented Sep 16, 2019

Hi there!

In case you missed it, I'm working on abandoning patchwork/utf8 in favor of symfony/symfony#33553 In this PR, I'm using transliterator_transliterate() to implement UTF-8 to ASCII transliterations (see AbstractUnicodeString::ascii()). But when the intl extension is not installed, I just skip the call and fallback to NFKC + maps + iconv.

It would be super cool if we could polyfill this function from intl (a subset of its behavior at least). This package is the closest I know. Would you consider porting it to https://github.com/symfony/polyfill/tree/master/src/Intl?

@GrahamCampbell
Copy link
Contributor

Interesting. This package is actually brand new, extracted from the Stringy and portable-utf8 packages, and was created, at least in part, by my desire to have Laravel 7 start using this package's ascii conversion: voku/Stringy#20, laravel/framework#29947.

@voku
Copy link
Owner

voku commented Sep 17, 2019

@nicolas-grekas interesting package and what a loop :) https://github.com/nicolas-grekas/symfony/blob/string-component/src/Symfony/Component/String/Utf8String.php#L99 ... and yes I can / will try to use this library as polyfill.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants