Skip to content
This repository has been archived by the owner on Dec 11, 2020. It is now read-only.

transliterator_transliterate "unable to open ICU transliterator" #520

Closed
yoghi opened this issue Feb 16, 2015 · 13 comments
Closed

transliterator_transliterate "unable to open ICU transliterator" #520

yoghi opened this issue Feb 16, 2015 · 13 comments

Comments

@yoghi
Copy link

yoghi commented Feb 16, 2015

In the library was used if (function_exists('transliterator_transliterate')) but isn't a garantee that all ICU transliterator necessary was installed

b>Warning</b>:  transliterator_transliterate(): Could not create transliterator with ID &quot;Any-Latin; Latin-ASCII; NFD; [:Nonspacing Mark:] Remove; NFC; Lower();&quot; (transliterator_create: unable to open ICU transliterator with id &quot;Any-Latin; Latin-ASCII; NFD; [:Nonspacing Mark:] Remove; NFC; Lower();&quot;: U_INVALID_ID) in <b>/home/returntogf/bin/test.php5</b> on line <b>6</b><br />
@fonsecas72
Copy link
Contributor

Hi,
Can you suggest a solution for this?
Do you think that the following would fix the issue for you?

if (function_exists('transliterator_transliterate') && $transliterator = Transliterator::create("Any-Latin; Latin-ASCII; NFD; [:Nonspacing Mark:] Remove; NFC; Lower();") !== null) {
     $transString = $transliterator->transliterate($string)
} else {
    $transString = static::toAscii($string);
}...

@yoghi
Copy link
Author

yoghi commented Feb 16, 2015

fixed for me :)

@fonsecas72
Copy link
Contributor

@fzaninotto what do you think?

@adamlc
Copy link

adamlc commented Feb 26, 2015

@fonsecas72 unfortunately your fix doesn't seem to work for me :(

I'm running php5.4 inside a docker container if that makes any difference? I have a feeling the webtatic.com el6 repos have a broken implementation of something somewhere!

PHP Warning:  transliterator_transliterate(): Could not create transliterator with ID "Any-Latin; Latin-ASCII; NFD; [:Nonspacing Mark:] Remove; NFC; Lower();" (transliterator_create: unable to open ICU transliterator with id "Any-Latin; Latin-ASCII; NFD; [:Nonspacing Mark:] Remove; NFC; Lower();": U_INVALID_ID) in /root/core/workbench/jumplead/apiv1/vendor/fzaninotto/faker/src/Faker/Provider/Internet.php on line 150

@adamlc
Copy link

adamlc commented Feb 26, 2015

Turns out the ICU and ext-intl where seriously out of date in the el6 repos. I installed ICU and pecl intl from source and it's now fixed :)

@fzaninotto
Copy link
Owner

That doesn't silence the warning, does it?

@fonsecas72
Copy link
Contributor

I don't think so, but @yoghi can you help with the answer to that?

@yoghi
Copy link
Author

yoghi commented Feb 27, 2015

@adamlc which linux distro have you used?

@fonsecas72
Copy link
Contributor

@yoghi I'm sorry, I think you misunderstood the question.
My question was about the likely silencing of the warning if we use my fix for this problem. I assume that you have applied my suggestion so, when you did that, did you get any warning?

@adamlc
Copy link

adamlc commented Mar 2, 2015

@yoghi I'm using CentOS 6 and the php 5.4 repos from webtatic.com

@Perfect-Web
Copy link

it happens to me as well, very annoying

@fzaninotto
Copy link
Owner

Can you post an update which silences the warning?

@fonsecas72
Copy link
Contributor

@fzaninotto this should avoid the php warning #541

fzaninotto added a commit that referenced this issue Mar 18, 2015
Avoids php warning "Could not create transliterator" - fixes #520
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants