Using ajax pager in accounts list, or in some users/accounts ajax autocomplete, seems that the data from the db is in a format (ISO-8859-1 ??) that json_encode() doesn't accept: Invalid UTF-8, so the ajax call doesn't respond anything and shows an empty table (pager) or empty autocomplete result.

Comments

XaviP created an issue. See original summary.

XaviP’s picture

It seems a bad configuration in database.
Some data from db is shown as black question mark.

And from db configuration:

SHOW VARIABLES LIKE 'character\_set\_%';
+--------------------------+--------+
| Variable_name            | Value
+--------------------------+--------+
| character_set_client     | latin1
| character_set_connection | latin1
| character_set_database   | utf8
| character_set_filesystem | binary
| character_set_results    | latin1
| character_set_server     | latin1
| character_set_system     | utf8
+--------------------------+--------+

character_set_server must be utf8

How to solve it

  • edumag committed 949099c on 7.x-1.x
    #2666862: Warning: json_encode
    
edumag’s picture

Status: Active » Closed (fixed)

The problem comes from using the functions strlen to count characters
and substr to cut, this functions not consider utf8.

You need to use mb_strlen, mb_substr, ....