-
-
Notifications
You must be signed in to change notification settings - Fork 0
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
Mbstring class error on convEncoding method #3
Comments
Does |
According to php documention in my tests returning false is not for all datas |
mostly likely the input string is out of ASCII region and not utf-8, otherwise I see no reason a utf-8 valid string failed to be converted into utf-32. |
Just to make sure, $ php -r "var_dump(iconv('UTF-8', 'UTF-32', '1H*Ì*1'));" shows $ php -r "var_dump(iconv('UTF-8', 'UTF-32', 'Ì'));" shows |
i couldn't detected data that result false returning for iconv but this hapend multiple times in production. when iconv can return false i think it's better to handle failure state for using it |
do you have php mbstring extension installed? |
you don't have to. you just have to execute those 2 cli commands and tell me the returned data in the console. |
|
|
Hmm... looks perfect to me. So I would assume the issue is that some of your UTF source code files are not UTF-8 encoded.
As you can see, your example data can't reproduce the issue from the console. |
You can try to use mbstring by default to see whether it works. Just change the order of these two php-mb-string/src/MbString.php Lines 347 to 358 in 8407bfe
|
i have no problem to solve this problem but when i am using composer to update dependencies, all changes will be replaced. i created this issue to fix bug for returning false state when using iconv |
Without your experiments, no one knows how to fix it because obviously I am not affected. And you are the first one who is affected since this lib has been created, at least from the issue list here. |
What you have changed on your side? |
method return type is string and return value of calling
iconv
method returned directly buticonv
method can sendfalse
return sometimes and create a Fatal Errorphp-mb-string/src/MbString.php
Line 360 in 8407bfe
need change
sample data
'1H*Ì*1', 'UTF-8', 'UTF-32'
The text was updated successfully, but these errors were encountered: