mymysql
mymysql copied to clipboard
Problem with character encoding
This is almost certainly me making a stupid mistake but I don't know where else to ask!
I am attempting to insert UTF-8 encoded data into a table. If I insert the data directly using the mysql command prompt, it works fine. If I use mymysql, L’ Échafaud
becomes L’ Échafaud
.
It was my understanding that mymysql uses UTF-8 by default. Just in case I added the explicit db.Register("set names utf8")
but that hasn't helped either.
Is there something else I need to do in Go to insert UTF-8 encoded strings?
Dnia 09.02.2013 o 03:39 Matthew Bessey [email protected] Matthew
Bessey [email protected] napisał(a):
This is almost certainly me making a stupid mistake but I don't know
where else to ask!I am attempting to insert UTF-8 encoded data into a table. If I insert
the data directly using the mysql command prompt, it works fine. If I
use mymysql,L’ Échafaud
becomesL’ Échafaud
.It was my understanding that mymysql uses UTF-8 by default. Just in case
I added the explicitdb.Register("set names utf8")
but that hasn't
helped either.Is there something else I need to do in Go to insert UTF-8 encoded
strings?
Reply to this email directly or view it on GitHub: https://github.com/ziutek/mymysql/issues/57
You only need to use "set names utf8" command. Try it in mysql.
What encoding is used in table? Is it VARCHAR or TEXT field?
Please don't create issue in tracker if you only want ask question.
Michał Derkacz
Hey, apologies for asking in the wrong place, would you rather move this discussion elsewhere? My email is [email protected]
add this to section [mysqld] in my.cnf
character-set-server=utf8
collation-server=utf8_unicode_ci