using ruby's mysql gem i'm inserting a new row into a table wich has encoding utf8_spanish_ci.
here's the code i'm executing
require 'mysql'
con = Mysql.new(#connecionparameters)
rs = con.query("INSERT INTO `qubi_horoscopo`.`signos` (`name`) VALUES ('acción')")
and when i query the table i get the following result :
id name
1 acción
i've checked that i'm using the same collation in the database, table and column. so i don't know what's going wrong.
any idea? thanks!
I've solved this executing
con.query("SET NAMES UTF8")
right before my insert query.
i hope this helps anyone having the same problem. i don't know if it's the best solution.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.