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

Gábor Hojtsy’s picture

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.

juhaniemi’s picture

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.

liquidcms’s picture

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.

cptX’s picture

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.

brunorios1’s picture

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

NZXT.’s picture

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

SebCorbin’s picture

Status: Active » Postponed (maintainer needs more info)

Please provide a full walkthrough to reproduce this bug