Error: Incorrect string value (Input Chinese characters)

This public forum is for user-to-user discussions of PHPMaker. Note that this is not support forum.
Post Reply
lamany77
User
Posts: 144

Error: Incorrect string value (Input Chinese characters)

Post by lamany77 »

hi all
i've try to input chinese character on textbox
i've got error :

测试

"Failed to execute SQL. Error: Incorrect string value: '\xE6\xB5\x8B\xE8\xAF\x95' for column 'invoice' at row 1 (1366)"

any idea ?


arbei
User
Posts: 9292

Post by arbei »

Check your database schema and the defined charset of your database/table/field.


lamany77
User
Posts: 144

Post by lamany77 »

i've try on datebase server

  1. set mysql tabel name "test" characterset : utf8
  2. set collation : utf8_general_ci

but not works


arbei
User
Posts: 9292

Post by arbei »

But the error message did tell you that your database considered the utf-8 string incorrect.

  1. Check if the field "invoice" in your database is of string type (e.g. varchar) and has character set and collation specified. If unspecified, it should use the table's charset/collation and it should work.
  2. If you use MySQL 8, you better use utf8mb4 and collation for utf8mb4.
  3. Check your connection info and Database_Connecting server event (if any) to make sure you connect to to correct database.
  4. Make sure the project charset is also set to "utf-8".

lamany77
User
Posts: 144

Post by lamany77 »

thank you for your detail explanation


Post Reply