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

Helpdesk for my helpdesk software

Moderator: mkoch227

Post Reply
mbenin
Posts: 3
Joined: Mon Jun 11, 2012 7:37 pm

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

Post 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.
mbenin
Posts: 3
Joined: Mon Jun 11, 2012 7:37 pm

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

Post 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
Klemen
Site Admin
Posts: 10145
Joined: Fri Feb 11, 2005 4:04 pm

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

Post 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
Klemen, creator of HESK and PHPJunkyardWas this helpful? You can buy me a drink here Image

Image You should follow me on Twitter here

Help desk software | Cloud help desk | Guestbook | Link manager | Click counter | more PHP Scripts ...

Also browse for php hosting companies, read php books, find php resources and use webmaster tools
mbenin
Posts: 3
Joined: Mon Jun 11, 2012 7:37 pm

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

Post 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.
Klemen
Site Admin
Posts: 10145
Joined: Fri Feb 11, 2005 4:04 pm

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

Post 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).
Klemen, creator of HESK and PHPJunkyardWas this helpful? You can buy me a drink here Image

Image You should follow me on Twitter here

Help desk software | Cloud help desk | Guestbook | Link manager | Click counter | more PHP Scripts ...

Also browse for php hosting companies, read php books, find php resources and use webmaster tools
Post Reply