2

We are installing a new application, the pre-requisite of which says that your database must be configured to use the UTF-8 character set.

We are currently using SQL Server 2016, enterprise edition.

Our database team mentioned to us that SQL Server doesn't support UTF-8 and have suggested to use nChar and nVarchar datatype for UTF-8 character set support.

I am not a database expert unfortunately. Could someone please help understand what exactly could be done here?

Newbie
  • 713
  • 2
  • 10
  • 19
  • It's true, no UTF-8 in SQL Server 2016 (indeed, it's been announced as a new feature for the 2019 version). You can use `n(var)char` for Unicode strings; but be aware that it's a 16-bit encoding (not, *precisely*, UTF-16, if memory serves, but the older one, whatever it was called). – Damien_The_Unbeliever Oct 05 '18 at 11:47
  • 4
    If the vendor application supports SQL Server, I'd expect their schema uses nchar/nvarchar thpes, which support all the characters as UTF-8 but with physical storage as UCS-2. No special database configuration needed in that case. On a separate note, native UTF-8 support has been added to the recently announced SQL Server 2019 version. – Dan Guzman Oct 05 '18 at 11:47
  • Note that SQL Server 2012 brings support of UTF-16 for nchar and nvarchar: https://learn.microsoft.com/en-us/previous-versions/sql/sql-server-2012/ms143726(v=sql.110)#supplementary-characters – Antoine Mottier Feb 08 '19 at 16:59
  • im on SQL Server 13, and which UTF8 collations should i use? – Dee Jun 22 '20 at 08:18

0 Answers0