node-mariasql
node-mariasql copied to clipboard
Issues with Charset
Hi,
Don't understand why got this problem. Data are stored in utf8_bin in database. When i query with node, got special chars instead of accentued ones.
no problems quering with another client got correct chars.
Impossible to get correct encoding characters while quering with mariasql node client.
That's bad cause ont functionality i like is to use objects with queries in data injection.
The connection charset is wrong. You can work around it by sending SET NAMES 'utf8'
upon connecting. I think this should be done properly by the library, though.
I attempt to do lot of things, SET NAMES 'utf8' doesn't change Anything.
I replaced the node MariaSQL client with Mysql Node client, and everything worked properly. So sad.
i had issues with persian characters, result only show "?" as every characters after couple of hours, it's solved before executing any queries , i run SET NAMES 'utf8' ,
c.query('SET NAMES \'utf8\'', function (err, rows) { if (err) throw err; console.dir(rows); });
c.query('select * from chert', function (err, rows) { if (err) throw err; console.dir(rows); });
@ali-khabbaz ohhhh.... good solution, but this is not efficient for big cluster (~5,000,000 records).
This works too
var c = new Client({
charset: 'utf8',
})