Warning: json_encode(): Invalid UTF-8 sequence in argument in /var/www/plugins/LoginLdap/GigatecLdap.php on line 41

I added this LoginLdap plugin (Link) to piwik and while it’s running perfectly on other machines without any problems, on my debian box it doesn’t.

Connection to LDAP server works, but as soon as I try to login via a LDAP user I get the error:

Warning: json_encode(): Invalid UTF-8 sequence in argument in /var/www/plugins/LoginLdap/GigatecLdap.php on line 41

I asked google and found that it might be a problem concerning how php json_encode() function contacts MySQL, but I just don’t know how to fix it since the PDO connection is obviously done with Zend in Piwik and I’m quite a beginner in PHP.

What could I do to fix the problem?

Can you please post in the LDAP plugin ticket, maybe the dev can help ?

otherwise, try to do a var_dump( $variable) of the variable before the line 41 to see what value it is trying to encode?

[quote=matt]
Can you please post in the LDAP plugin ticket, maybe the dev can help ?[/quote]

I’m afraid I don’t know what that is exactly?

That’s a good hint thanks, it has shown me that indeed there seems to be a problem with enoding, since the array contains some weird characters.

What can I do? Error appears actually in line 44 of the latest sources, which you can find here:

http://code.google.com/p/piwik-ldap/source/browse/trunk/LoginLdap/GigatecLdap.php

I might try to contact the dev, but I wanted to ask here too.

please post your bug report on: Plugin for LDAP Authentication · Issue #734 · matomo-org/matomo · GitHub