I have the following problem:
I'm making an INSERT INTO
with Golang, but for some reason, it's not inserting the special characters correctly (IE: ñ
).
This is the SQL sentence:
ins, err := db.Prepare("INSERT INTO historico_twitter_instagram( texto_encontrado,
busqueda_realizada, id_usuario, link, total_reacciones,
total_negativas, total_positivas, total_neutras, fecha_publicacion,
id_red_social,is_falso_positivo,ID_comentario)
VALUES "+ fmt.Sprintf("%s",buscado))
Right above it I have a print to show in console what is supposed to insert, and it shows this:
INSERT INTO historico_twitter_instagram( texto_encontrado, busqueda_realizada,
id_usuario, link, total_reacciones, total_negativas, total_positivas,
total_neutras, fecha_publicacion,id_red_social,is_falso_positivo,ID_comentario)
VALUES ('Test: ñ','@wtonki','999','','1','0','0','1','2017-10-24 00:00:00.0','2','1',
'922923057840144384')
But in phpMyAdmin it's replacing the ñ
character for other characters like ñ
The strange part is, if I execute that SQL manually, it inserts okay. Any ideas?
PS: The table structure has utf8_general_ci
PS2: Sorry for my bad English! :(
PS3: The SQL is executed on Go with _, err = ins.Run()