Skip to content
This repository has been archived by the owner on Jan 8, 2021. It is now read-only.

Error when using Utf8::strlen() function. #57

Closed
basilmusa opened this issue Jan 16, 2016 · 1 comment
Closed

Error when using Utf8::strlen() function. #57

basilmusa opened this issue Jan 16, 2016 · 1 comment

Comments

@basilmusa
Copy link

I'm using php 5.5.19.
I don't have mb_string, iconv or intl extensions enabled.

I get the following error when using Utf8::strlen(..):

Fatal error:  Call to undefined function Patchwork\grapheme_strlen() in ....\vendor\patchwork\utf8\src\Patchwork\Utf8.php on line 234

According to the documentation, there is a fallback implementation, but when trying Utf8::strlen() no fallback implementation is active.

Am I doing something wrong, or does Utf8::strlen() require intl extension to be enabled?
By what other means can I get the length of a utf8 string?

Thanks in advance.

@basilmusa
Copy link
Author

Okay, my mistake.
I should have called the following at the top of my test file:

\Patchwork\Utf8\Bootup::initAll(); // Enables the portablity layer and configures PHP for UTF-8
\Patchwork\Utf8\Bootup::filterRequestUri(); // Redirects to an UTF-8 encoded URL if it's not already the case
\Patchwork\Utf8\Bootup::filterRequestInputs(); // Normalizes HTTP inputs to UTF-8 NFC

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

1 participant