John Voltaire Maximo
John Voltaire Maximo

Reputation: 93

varchar data type doesn't accept character from data dump

My import query doesn't push through because a certain special chinese character in my data dump interferes with the command. It says "#1366 - Incorrect string value: '\xDA?????...' for column 'Description' at row 1"

the description field is currently a varchar type with a length of (5000). What do you think causes this problem? Are there perhaps a problem with the content of the dump? Are there special characters that are incompatible to this varchar data type? Are there workarounds or fix for this?

Upvotes: 2

Views: 2112

Answers (2)

John Voltaire Maximo
John Voltaire Maximo

Reputation: 93

Just an update on the problem. I actually was able to fix it by using only standard notepad to convert the csv file's character encoding to utf8. I also changed the table and database defaults to utf8. After that, only minor modifications to the data type lengths and I was able to completely import the data. Thank you for your suggestions.

Upvotes: 0

rd_nielsen
rd_nielsen

Reputation: 2459

You should use nvarchar instead of varchar and ensure your input data is in the same encoding as your database.

EDIT: Just noticed the mysql tag; you should use "character set utf8" in your column declaration.

Upvotes: 1

Related Questions