SQL Connector and N prefix in SQL Server

I cannot presuade SQL DB Connector to send proper ‘unicode’ field values to the SQL Server if they are sent as parameters. For instance, the setting

writes this to the database:

abc`}
a~

(one of the characters is actually transformed to carriage return :expressionless: )

Usually this is done with the N prefix (e.g. N’somestring’), but there’s no way to successfully put the N prefix into the INSERT statement. For instance, this of course doesn’t work:

INSERT INTO [dbo].[test] ([Opis]) VALUES (N'@param')

nor this one (which is strange):

EXEC('INSERT INTO [dbo].[test] ([Opis]) VALUES (N''' + @param + ''')')

What character set / collation is the column set to? That’s the MySQL terminology, I don’t remember the SQL Server version …

I tested on MySQL and didn’t need to change on Bubble’s side, just set the column collation type to utf8 on the database.

The funny thing is that this works nice:

INSERT INTO [dbo].[test] ([Opis]) VALUES ('蚞ȊŽ')

SQL Server, prior to version 2012, stores unicode internally as UCS-2, which is a kind of UTF-16. It seems that connector sends characters in UTF-8 and somehow stripes the upper byte off, if you use parameters.

I sent a bug report and now we are investigating …

This is now solved with plugin fix.