• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 595
  • Last Modified:

IDN domain saving in SQL database

Hi

Have MS SQL database for domain names but recently been getting idn domains and cannot save them  as text versions only punny version -  in sql do I need a special feild type?

e.g of a domain in punny is xn--48j.net and in text U.net (will not save as this!)

Rgds
stephen
0
stephenwilde
Asked:
stephenwilde
  • 3
  • 2
1 Solution
 
Raja Jegan RSQL Server DBA & ArchitectCommented:
>> but recently been getting idn domains and cannot save them  as text versions only punny version -  in sql do I need a special feild type?

If I am correct idn domains refers to International domains, right..
To save International characters in SQL Server, you have to use / store those values into nchar/nvarchar/ntext datatype columns instead of char/varchar/text columns..

Say if 'abc' is your international character, then inserting into a nchar/nvarchar/ntext column by prefixing N like N'abc' would retain the international characters..
Else those international characters would be ripped off..

Note: text and ntext are going to be deprecated in later versions and hence go for nchar/ nvarchar
0
 
stephenwildeAuthor Commented:
Hi

Thanks for idea but it did not seem to work fully idn punny is xn--48j.net which translates in to U.net

but when saved in nvarchar it was shown as  square box .net in sql but when copied and pasted contents to here it was U.net again - so it may be limitation of sql manager displaying values?

Rgds
stephen

 
 
0
 
Raja Jegan RSQL Server DBA & ArchitectCommented:
>> it did not seem to work fully idn punny is xn--48j.net which translates in to U.net

So where is it exactly translated to U.net from xn--48j.net.
Kindly check that one out..

if it is showing as boxes in SQL Server, then it was a Unicode character for sure and if you have the language pack installed in your server, it would display that properly.
Else the unicode characters are tampared as you mentioned earlier and hence you haven't passed that correctly to your SQL Server..

And as mentioned earlier, have you prefixed your idn like N'xn--48j.net' so that your unicode characters are not lost..
0
 
stephenwildeAuthor Commented:
Thanks very much
0
 
Raja Jegan RSQL Server DBA & ArchitectCommented:
Welcome..
0

Featured Post

The new generation of project management tools

With monday.com’s project management tool, you can see what everyone on your team is working in a single glance. Its intuitive dashboards are customizable, so you can create systems that work for you.

  • 3
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now