8000 Exception "Symfony\Component\String\UnicodeString" requires a translit-able iconv implementation... · Issue #38060 · symfony/symfony · GitHub
[go: up one dir, main page]

Skip to content

Exception "Symfony\Component\String\UnicodeString" requires a translit-able iconv implementation... #38060

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

Closed
Surfoo opened this issue Sep 4, 2020 · 5 comments

Comments

@Surfoo
Copy link
Surfoo commented Sep 4, 2020

Symfony version(s) affected: 5.1.5

Description
With Windows 8 and PHP 7.4, an exception is thrown:

Here the phpinfo if needed : https://gist.github.com/Surfoo/293c14052c882c08bfab1368af38a3e7

Exception "Symfony\Component\String\UnicodeString" requires a translit-able iconv implementation, try installing "gnu-libiconv" if you're using Alpine Linux.

Exception

How to reproduce

In a controller :

 dd((string) $this->slugger->slug('🐎 test unicode character'));
@notFloran
Copy link
Contributor

I have the same issue with macOS Catalina and homebrew:

php -v:

PHP 7.4.10 (cli) (built: Sep  3 2020 18:21:42) ( NTS )
Copyright (c) The PHP Group
Zend Engine v3.4.0, Copyright (c) Zend Technologies
    with Zend OPcache v7.4.10, Copyright (c), by Zend Technologies
    with blackfire v1.39.1~mac-x64-non_zts74, https://blackfire.io, by Blackfire

php --ri iconv:

iconv

iconv support => enabled
iconv implementation => libiconv
iconv library version => 1.11

Directive => Local Value => Master Value
iconv.input_encoding => no value => no value
iconv.output_encoding => no value => no value
iconv.internal_encoding => no value => no value

I try #38195 and no changes.

@nicolas-grekas
Copy link
Member
nicolas-grekas commented Sep 15, 2020

What's the output of this on your machine?

var_dump(iconv('UTF-8', 'ASCII//TRANSLIT', '²'));
var_dump(iconv('UTF-8', 'ASCII//TRANSLIT', 'é'));

@notFloran
Copy link
Contributor

Result:

php > echo iconv('UTF-8', 'ASCII//TRANSLIT', '²');
^2
php > var_dump(iconv('UTF-8', 'ASCII//TRANSLIT', 'é'));
string(2) "'e"

@nicolas-grekas
Copy link
Member

Thanks, can you try #38195 again?

@notFloran
Copy link
Contributor

Thanks, can you try #38195 again?

It's good 👍 , thanks

@fabpot fabpot closed this as completed Sep 16, 2020
fabpot added a commit that referenced this issue Sep 16, 2020
…ions of iconv() (nicolas-grekas)

This PR was merged into the 5.1 branch.

Discussion
----------

[String] improve slugger's portability accross implementations of iconv()

| Q             | A
| ------------- | ---
| Branch?       | 5.1
| Bug fix?      | yes
| New feature?  | no
| Deprecations? | no
| Tickets       | Fix #36880, fix #38060
| License       | MIT
| Doc PR        | -

Ping @Surfoo @edguar, can you please confirm that this fixes your issues?

Commits
-------

21e4e32 [String] improve slugger's portability accross implementations of iconv()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants
0