When outputting a string from the database containing "Hello" to the console, abracadabra is displayed.

... var mysql= require('mysql'); var connectionmysql = mysql.createConnection({ host : 'localhost', user : 'user', password : 'password', database : 'database' }); connectionmysql.connect(); connectionmysql.query('SELECT * FROM dopuslugi WHERE id=?',[msg.id], function(err, rows, fields) { console.log(rows[0].name); }); 

Adding to mysql.createConnection charset: 'utf8' does not help, adding

 connectionmysql.query("SET NAMES utf8"); connectionmysql.query("SET CHARACTER SET 'utf8'"); connectionmysql.query("SET SESSION collation_connection = 'utf8_general_ci'"); 

Does not help. Through PHP, this string is output without distortion.

  • We must try to decrypt the Abrocadabra, for example, through Lebedevsky's “Automatic Mail Decoder,” well, or any other decoder of the encoding, and from that to look for a problem, maybe the answer comes in BASE64 - pnp2000

1 answer 1

Data was inserted into the database via PHP, and it was incorrectly configured to work with UTF-8.