Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Hi,
I had the following warning in some pages:
htmlspecialchars(): Invalid multibyte sequence in argument in ...\sites\all\modules\l10n_client\l10n_client.module on line 306.
so, the line 306 contains that:
$source = $values[0] === TRUE ? '' : htmlspecialchars($values[0], ENT_NOQUOTES, 'UTF-8');
I modified that line:
$source = $values[0] === TRUE ? '' : @htmlspecialchars($values[0], ENT_NOQUOTES, 'UTF-8');
to avoid the warning.
Is there a way in PHP to know what string of $values[0] throws the warning?
Is that issue solved in the last release?
Thanks
Comments
Comment #1
Gábor HojtsyWell, you can use a debugger to track down what causes this or print $values[0] on the line before and see what it outputs. I have not seen this issue before on any of my setups.
Comment #2
juhaniemi CreditAttribution: juhaniemi commentedAlso having this issue with 7.x-1.0-beta3. Warnings showing up only on my site's frontpage. Didn't have a debugger available to see which strings causes these. _snake_'s suggestion at least hides the warning.
Comment #3
liquidcms CreditAttribution: liquidcms commentedi have just started seeing this as well on our demo server but when i transfer db over to my devel PC i don't see it (so i can't debug the issue yet).. so if not happening in both places with same db and same code; i need to check version of PHP on both systems (although i think it is the same).
will report back when i find the issue.
Comment #4
cptX CreditAttribution: cptX commentedHi, I'm having the same issue too. I was coping my development site to a brand new production site and I had installed the jQuery update 6.x-2.0-alpha1 which was causing me a lot of problems. After that I realized that this was the cause and I installed the jQuery update 6.x-1.1. All the other problems disappeared but this problem "htmlspecialchars(): Invalid multibyte sequence in argument in ..." started appearing!! The important thing is that in my dev site I have no problems at all? Is there any case the jQuery is causing these problems?
Also, I should mention that this is a multilingual site and I have setup the main language to greek. Also, I am writting all the labels and text in the system fields (views... etc) in Greek and then tranlate them to english.
Comment #5
brunorios1 CreditAttribution: brunorios1 commentedsame here in 6.x-2.0:
warning: htmlspecialchars(): Invalid multibyte sequence in argument in .../sites/all/modules/l10n_client/l10n_client.module on line 313
Comment #6
NZXT. CreditAttribution: NZXT. commentedWarning: htmlspecialchars(): Invalid multibyte sequence in argument in function _l10n_client_dom_strings() (string 329 in file .../sites/all/modules/l10n_client/l10n_client.module).
Comment #7
SebCorbin CreditAttribution: SebCorbin commentedPlease provide a full walkthrough to reproduce this bug