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:

<?php
$source
= $values[0] === TRUE ? '' : htmlspecialchars($values[0], ENT_NOQUOTES, 'UTF-8');
?>

I modified that line:

<?php
$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

Well, 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.

Also 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.

i 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.

Hi, 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.

same 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

Version:6.x-1.7» 7.x-1.1

Warning: htmlspecialchars(): Invalid multibyte sequence in argument in function _l10n_client_dom_strings() (string 329 in file .../sites/all/modules/l10n_client/l10n_client.module).

Status:Active» Postponed (maintainer needs more info)

Please provide a full walkthrough to reproduce this bug