开发者

mysql ’ show up as ’

when I try and run:

mysql -u myUser -pPassword -D myDatabase -h myHost < toInsert.sql

from my ubuntu desktop where myHost is a remote Red Hat server and toInsert.sql contains they show up as ’

How can I resolve this?

Note! is NOT the same as '

When I run toInsert.sql from a windo开发者_开发知识库ws machine with a mysql gui client I do not have this problem.

Thanks


--default-character-set=utf8 has fixed it

so

mysql -u myUser -pPassword -D myDatabase -h myHost --default-character-set=utf8 < toInsert.sql

thanks for the help!


Sounds like you've got code that's confused about encodings. Define what the encoding of the string data in the database is (I recommend UTF-8, but anything will work so long as you're consistent) and then make sure that all the tools you use with it realize that fact.

And “’” is a “” when the UTF-8 data bytes are reinterpreted as ISO 8859-1.


There are two places this problem could be:

First, you need to check that the encoding on everything in your database is UTF-8.

If that doesn't fix it, then your database might be correct, but your console is unable to display UTF-8 characters. Pipe the output of a query into a file and view it in something that can display UTF-8 characters and see if it looks correct. If it looks correct, then the problem is your terminal.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜