0

When i am visiting my site individual article page url in chinese language got below error, even this URL working fine in my localhost.

Uncaught exception 'PDOException' with message 'SQLSTATE[HY000]: General error: 1366 Incorrect string value: '\xE7:titl...' for column 'location' at row 1' in /var/www/includes/database/database.inc:2204 cloud-server-01 /zh-hans/articles/%E5%9D%90%E6%8B%A5%E5%95%

1

This error might appear when the MySQL database is encoded as UTF8. In that case, Unicode characters represented with 4 bytes are not accepted. The accepted reply to the following StackOverflow question explains that the database needs to be encoded using the utf8mb4 encoding and the utf8mb4_unicode_ci collation:

https://stackoverflow.com/questions/10957238/incorrect-string-value-when-trying-to-insert-utf-8-into-mysql-via-jdbc

A more complete explanation about the utf8mb4 encoding on MySQL can be found here:

https://mathiasbynens.be/notes/mysql-utf8mb4

In case you need to re-encode your existing Drupal database, there is an experimental Drush command for it at UTF8MB4 Convert.

| improve this answer | |
  • The column's collation is utf8_general_ci.What could be the problem? – Surya Prakash Nov 21 '16 at 12:21
  • @Suraj I think the collation needs to be utf8mb4_unicode_ci instead. I have just edited my answer with some additional details. – dinopmi Nov 21 '16 at 12:54

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.