3

In SQL Server, I am trying to create a table that can store unicode characters. Specifically this one

https://www.fileformat.info/info/unicode/char/0144/index.htm

However if I pick nvarchar as the column type, then store it and then select it, it shows as a regular n.

How can I get it to store properly?

marc_s
  • 732,580
  • 175
  • 1,330
  • 1,459
omega
  • 40,311
  • 81
  • 251
  • 474
  • 1
    Make sure the column type is `NVARCHAR([length])` and if you are inserting strings, prefix them with `N'mystring'` so that it knows they're unicode. – EMUEVIL Jun 26 '18 at 15:52

1 Answers1

10

This works fine

DECLARE @t TABLE
(
InputChar NVARCHAR(10)
)

INSERT INTO @t (InputChar)
VALUES (N'ń')

INSERT INTO @t (InputChar)
VALUES ('ń')

SELECT * FROM @t

Uniode Results

Are you making sure that when you inserting your strings you are specifying that the string is unicode ? e.g.N'yourstring'

codingbadger
  • 42,678
  • 13
  • 95
  • 110