I'm getting a special characters from a latin1_swedish_ci database. It contains a huge amount of data, and migration is not a option :(. The new app has all its files encoding are utf8, and we are looking for conversion solution, from latin1 to uft8. The charset on mysql2, plus set names, etc.. I also try any other suggestions using iconv (version dependency) from internet that I could not make them work, So I ended up developing some code that seems works and fixes the problem.
However, it is very obvious...do you see something wrong in the code?
let data = JSON.stringify(rows); // list of mysql objects swedish encoding to string
data = Buffer.from(data, "latin1"); // to bynary
data = data.toString("utf8"); // to utf8
rows = JSON.parse(data); // to json
String example before apply the code below:
Distributeurs: N° 5/6
Thanks!