1

I was trying to store some chinese characters into mysql table.

they become something like this:

烈火雄心

They work fine when I output them in innerhtml, but if it's an html attribute, they won't show the chinese characters.

Strangely, if I saved the data in utf8_bin or utf8_unicode, they works ok.

Any fix to this?

To be more specific, I'm using codeIgniter when doing this.

Jonathan Chow
  • 703
  • 7
  • 29

2 Answers2

1

just making sure your table is ready for Chinese characters:

Go to your mysql table and change the "Character set" to "gb2312" and "Collation" to "gb2312_chinese_ci".

For me, I did it on a "row" level and not the whole table, since only I was only expecting Chinese characters in 1 field of my table.

Reference

Let me know if that helped.

George
  • 6,006
  • 6
  • 48
  • 68
1

Just modify the field's Collation to utf8_general.

Richard
  • 11
  • 1