Page 1 of 1

Incorrect string value: '\xED \xE1 \xE9 ...' pt-br

Posted: Mon Jun 11, 2012 8:21 pm
by mbenin
hi there,

i'm using hesk 2.3 and the portuguese-brazil translation.

i am facing a issue about charset when i update or insert some message that contains words with accent.

Not only messages (mail), but all the translated phrases (/translate/br/text.php) that contains accent, shows great on the html interface but when the hesk system saves some ticket, that is translated, and contains accents, i have the following error.


Não é possível executar este comando SQL: UPDATE `hesk_tickets` SET `status`='2',`lastreplier`='1',`replierid`='1',`lastchange`=NOW() ,`priority`='2', `history`=CONCAT(`history`,'
On 2012-06-11 17:17:49 prioridade alterada para Média por Your name (Administrator)
') WHERE `id`=2 LIMIT 1

MySQL retornou:
Incorrect string value: '\xE9dia

the text.php charset is set to ISO-8859-1 and Mysql is set to UTF-8. It´s does not matter if i change mysql collation to latin1, the error remain the same.

Re: Incorrect string value: '\xED \xE1 \xE9 ...' pt-br

Posted: Mon Jun 11, 2012 9:06 pm
by mbenin
and now sending a message:

Can't execute SQL: INSERT INTO `hesk_mail` (`from`,`to`,`subject`,`message`,`dt`,`read`) VALUES ( '2', '3', 'ííííí', 'teste', NOW(), '0')

MySQL said:
Incorrect string value: '\xED\xED\xED\xED\xED' for column 'subject' at row 1

The curious thing is that if i COPY AND PASTE the SQL into hesk_dbQuery() in string format and not as a variable ($sql) i can pass through without errors

Re: Incorrect string value: '\xED \xE1 \xE9 ...' pt-br

Posted: Tue Jun 12, 2012 8:09 am
by Klemen
That happens when your MySQL database doesn't accept characters. You will need to modify database charset to a collation that accepts those special chars, such as utf-8

Re: Incorrect string value: '\xED \xE1 \xE9 ...' pt-br

Posted: Tue Jun 12, 2012 6:26 pm
by mbenin
Klemen wrote:That happens when your MySQL database doesn't accept characters. You will need to modify database charset to a collation that accepts those special chars, such as utf-8
Nope.

All my tables and database collation is UTF8-BIN.

Another option ?

Thanks.

Re: Incorrect string value: '\xED \xE1 \xE9 ...' pt-br

Posted: Tue Jun 12, 2012 7:09 pm
by Klemen
Can you let me know what version of PHP and MySQL you are using?

Also try setting text.php charset to utf-8 and saving the file as utf-8 encoded without byte order mark (BOM).