-
-
Notifications
You must be signed in to change notification settings - Fork 149
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
Strings::toAscii returns empty string #107
Comments
php.ini:
nette/utils v2.3.8 |
It seem that the problem is only on chrooted ssh accounts. Is the iconv call necessary when |
Yes, it is... see #26 (comment) |
@xificurk Thank you very much. Ok, iconv is required. This issue is with chrooted accounts only and bad configuration. I've fixed configuration on the server. When I run So the problem is that iconv has no access for all charsets. Iconv in PHP nor system. Edit Jailkit config like this: # /etc/jailkit/jk_init.ini
[php]
comment = the php interpreter and libraries
executables = /usr/bin/php
directories = /usr/local/php
includesections = iconv # require iconv section for PHP
[iconv]
executables = /usr/bin/iconv # this is not required, but may helps with debug (i.e. iconv -l)
directories = /usr/lib/x86_64-linux-gnu/gconv # may be only /usr/lib/gconv
And reinit existing domains like this: jk_init -c /etc/jailkit/jk_init.ini -f -k -j /var/www/clients/client1/web1 php That's all, folks. |
When I run a PHP 7.0.3 CLI (Debian linux) application over SSH where I use
Strings::webalize
internally, I get empty strings as results in my nette-based app.A found that problem is in
Strings::toAscii
implementation which is called fromStrings::webalize
.Everything seems fine until
iconv (glibc)
call, this line.Transliterator
converts string correctly but iconv removes all of them.When I replace
iconv('UTF-8', 'WINDOWS-1250//TRANSLIT//IGNORE', $s)
withiconv('UTF-8', 'ASCII//TRANSLIT//IGNORE', $s)
, I get an output (but incorrect, with a question mark (?
) instead of some characters).The line with
iconv
has error supressing@
. So I get no error. When I remove it, I getPHP Notice: iconv(): Wrong charset, conversion from UTF-8 to WINDOWS-1250//TRANSLIT//IGNORE is not allowed
.Testing string:
Koupil pojišťovnu a chce převrátit v Česku pojišťovnictví naruby
, but same behaviour with everything. Output is an empty string also when input are ASCII characters only.Maybe, in my CLI there is something wrong with php.ini configuration. Am I first who have this problem? Is the call of
iconv
correct?Thank you for help.
The text was updated successfully, but these errors were encountered: