So I have this weird issue with node js right now and can not find any solution...
Im trying to insert values to my mssql table and some of the values includes the swedish characters "åäö". Anyhow when I do this they appear as "??????". Each special character appear as two question marks ("ö" -> "??").
Some details:
*Package I'm using is in js: msnodesqlv8
var sql = require('msnodesqlv8');
const connectionString = "server=host;Database=MyDb;Trusted_Connection=Yes;Driver={SQL Server Native Client 11.0}"
q = "Insert into [MyDb].[dbo].[MyTable] (testCol) values ('ö')"
sql.query(connectionString, q, (err,data) => {
if (err) {
console.log(err);
}
else {
console.log('Imported row to table.');
}
})
*The columns in the db table that will retrieve values containing "åäö" is defined as datatype nvarchar(50)
- I have also trid with N'ö' in variable q and these characters (within the double quotes) appear in db table "ᅢᄊ"
*console.log('ö') prints ö in console as expected
*I have tried all conversions i can think about in js (for example utf-8, latin1, etc...)
*Collation in db is Finnish_Swedish_CI_AS
*I have tried to read out swedish chrs from another table and it works fine through the package msnodesqlv8
The problem to me seems to be somewhere when sending the query from js (everything looks fine here), through package msnodesqlv8 and when mssql shall interpret the values. Im very glad if someone can help me.