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

Add translit for EUR symbol #464

Open
wants to merge 1 commit into
base: 1.x
Choose a base branch
from

Conversation

louismariegaborit
Copy link

Add translit for € to have same result.

Today, we have this :

\Symfony\Polyfill\Iconv\Iconv::iconv('UTF-8', 'ASCII//TRANSLIT', '€');
Result : false

iconv('UTF-8', 'ASCII//TRANSLIT', '€');
Result : EUR

With PR change, we have :

\Symfony\Polyfill\Iconv\Iconv::iconv('UTF-8', 'ASCII//TRANSLIT', '€');
Result : EUR

iconv('UTF-8', 'ASCII//TRANSLIT', '€');
Result : EUR

@nicolas-grekas
Copy link
Member

We've got the current list from https://github.com/unicode-org/cldr/blob/main/common/transforms/Latin-ASCII.xml
Our approach to defining these lists is to find a good source that we don't have to maintain.
It'd be interesting to see which implementation of iconv has the € => EUR mapping and see if we could leverage it.
There might be more characters to map.
(and we don't want to maintain our own custom map).
Could you please have a look?

@louismariegaborit
Copy link
Author

We've got the current list from https://github.com/unicode-org/cldr/blob/main/common/transforms/Latin-ASCII.xml Our approach to defining these lists is to find a good source that we don't have to maintain. It'd be interesting to see which implementation of iconv has the € => EUR mapping and see if we could leverage it. There might be more characters to map. (and we don't want to maintain our own custom map). Could you please have a look?

It's the conversion that debian do.

docker run --rm -it php:8.2-fpm-bullseye php -r "echo iconv('UTF-8', 'ASCII//TRANSLIT', '€')
EUR

The cldr repository have a specific section on currency symbol.
I understand that you can't maintain this specific list and my change is not good.
How we can support this character in the polyfill ?

@nicolas-grekas
Copy link
Member

We should try to understand how debian does the conversion. Where it gets the mapping from. Might be from cldr, or something else. Once we have the source, we can borrow from there.

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

Successfully merging this pull request may close these issues.

None yet

2 participants