我试图通过网络表单存储中文字符(指事字zhǐshìzì)。但是mysql数据库存储它们就像这样的“???zhishìzì”
我在stackoverflow上发布了类似的问题。但是找不到答案。
答案 0 :(得分:1)
我发现自己回答了问题。问题是连接字符串。
以前就像这样
<property name="connection.connection_string">Server=xxxxx;Database=xxxxx;User ID=xxx;Password=xxxx;Port=xxx</property>
我添加“CharSet = utf8”并且它可以工作:)
<property name="connection.connection_string">Server=xxxxx;Database=xxxx;User ID=xxx;Password=xxxxx;Port=xxxx;CharSet=utf8</property>
谢谢你的帮助...... !!