htmlspecialchars() [function.htmlspecialchars]: Invalid multibyte sequence in argument in C:\Program Files\Apache Software Foundation\Apache2.2\htdocs\...\sites\all\modules\l10n_client\l10n_client.module on line 306.

This comes out when I open a page with php that shows weather blocks from different countries.
Also in some taxonomy terms.

Comments

dustyfox’s picture

I keep getting this error too, don't know what it means but it's quite annoying.

rafa0961’s picture

I have this error too.
in the currency api module ( http://drupal.org/project/currency ) there are a list of currency propierties like

array(

'DZD' => array('name' => t('Algerian Dinar (DZD)'), 'symbol' => t('دج'), 'decimals' => 2),
.....

if you active the client footer they want to traslate this simbols and in the line 306
$source = $values[0] === TRUE ? '' : htmlspecialchars($values[0], ENT_NOQUOTES, 'UTF-8');
crash...

I dont know how solver the problem and comment this lines in currency module.

att
rmp

drubb’s picture

Title: php error Invalid multibyte sequence in argument » Seems that sometimes translation sources include PHP sequences

I'm getting this error, too. The reason seems to be, that the module doesn't recognize PHP sequences in some text areas. In my project, for example, I'm using PHP in some VIEWS header areas. So when I put the following in my VIEWS header:

<?php print l("New", "node/add/sometype");?>

the module treats this sequence as translation source, which imo shouldn't be.

Regards,
Boris

gábor hojtsy’s picture

Are you using i18n module as well?

_snake_’s picture

Subscribe,

// line 306
$source = $values[0] === TRUE ? '' : htmlspecialchars($values[0], ENT_NOQUOTES, 'UTF-8');

Is there a way in PHP to know what string of $values[0] throws the warning?

Thanks

bohz’s picture

Hallo.
I am experiencing the same error and I have i18n, i18n_views installed.
Cheers

gábor hojtsy’s picture

Project: Localization client » Internationalization
Version: 6.x-1.7 » 6.x-1.x-dev

Yes, the error is actually with those modules, or your expectations vs. your settings. i18n provides a settings page for permissions to decide who can edit strings in which input formats. If you use PHP input format for certain text, and you do not have permission to edit those translations but still could, there is some error with that. If you set it to allow PHP format editing, its you expect something else and it works right :)

Moving this to the i18n queue.

bohz’s picture

Thanks.
I had indeed disabled the translation of PHP strings in admin/settings/language/configure/strings.
Alas, even enabling this option didn't solve the problem.
Actually mine might be a different issue because the error is thrown by line 313, not 306:
//line 313
$target = $values[1] === TRUE ? '' : htmlspecialchars($values[1], ENT_NOQUOTES, 'UTF-8');

[EDIT]: just noticed it's the same string :)

jose reyero’s picture

Component: Code » Blocks
Status: Active » Closed (won't fix)

No follow up for too long. Cleaning up issue tracker for 6.x.