2

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
  • 704,970
  • 168
  • 1,303
  • 1,425
omega
  • 35,693
  • 74
  • 215
  • 425
  • 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

8

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
  • 40,660
  • 13
  • 93
  • 109