Domanda

I'm a little embarrassed to admit that I've never really needed to worry about Unicode text before in a SQL Server so I'm fumbling here.

I downloaded the Geonames Cities1000 data file and loaded it into SQL Server, with all the text fields as large nvarchars so as to avoid truncation. When I did a search for a city I know well (Bucerias, Mexico), I queried my table and found it but it's listed like this:

Bucerías

The actual spelling (what's in the file I imported and what's on the city sign when you drive in), is this:

Bucerías

Do I need to re-make my table with different collation? I'm handling city names from all over the globe so I'm sort of at a loss here on how to set up the collation for this, or if that's even my problem.

In short, I want Bucerías to appear as Bucerías, and مورای، یوتا,穆雷 to appear as مورای، یوتا,穆雷, etc.

È stato utile?

Soluzione

What ended up helping was picking the 65001 (UTF-8) code page. When I checked the Unicode box there it caused the parser to miss the deliminator control characters, so that's unchecked.

  1. Make sure the output column is set for Unicode text.
  2. Make sure the code page is set for 65001.
  3. Make sure the destination column (of the SQL table) is nvarchar.

Now my SQL query retruns Bucerías !

Here's a picture of what helped

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top