Our platform's database has stopped accepting non-ASCII characters despite it working before and despite full use of nvarchar type. The minimal reproduction I've been able to do is this simple demonstration from a Management Studio query window:
DECLARE @X nvarchar(max) = 'Activbasē ਪਾਕਿਸਤਾਨ ਪੰਜਾਬ ਦਾ ਦਾਰੁਲ'
PRINT @X
SELECT @X AS X
-- Output (for table and PRINT): Activbase ???????? ????? ?? ?????
I'm using:
(both latest versions to date)
Query Options for the query window for ANSI are as follows:
SET ANSI_NULLS = on
SET IMPLICIT_TRANSACTIONS = off
Thanks in advance.
You've made a tiny mistake, you've missed the N
prefix to show that your string is Unicode (National language character set):
DECLARE @X nvarchar(max) = N'Activbasē ਪਾਕਿਸਤਾਨ ਪੰਜਾਬ ਦਾ ਦਾਰੁਲ'
PRINT @X
SELECT @X AS X
Output:
Activbasē ਪਾਕਿਸਤਾਨ ਪੰਜਾਬ ਦਾ ਦਾਰੁਲ