2

I have a application that have lot of products with special alphabets like é, è, ê, ó, ò, â, and ô.

Now these alphabets gives me problem like when i store them in sql server these symbols get replaced by ?. I also find problem during the processing.

How can i handle these.

Should i keep on using string to handle them or use something else

What should be their data-types in sql-server

Any help is appreciated.

dove
  • 20,469
  • 14
  • 82
  • 108
Moons
  • 3,833
  • 4
  • 49
  • 82
  • What are the current data types in your database for these fields? What are the collations? How are you inserting to the database - can you post the code? – Oded Nov 22 '11 at 12:53
  • @Oded The data types are varchar and collations are the default one. i haven't changed default collations. I am inserting the data using Linq to Entities – Moons Nov 22 '11 at 12:55
  • I think that your problem is on your insert implementation command. – Aristos Nov 22 '11 at 13:00
  • 7
    Change your column types from `VARCHAR` to `NVARCHAR`. – Uwe Keim Nov 22 '11 at 13:05

1 Answers1

1

Have you tried using nvarchar as the datatype? This is usually recommended when storing non-English text (the cost is more storage space). We use nvarchar for Finnish text (ä ö å), and have no problems or special processing. If writing to a stream, then make sure to use the iso-8859-1 encoding (at least for scandic languages. Eastern European languages use a different one).

If its not possible for you to change the datatype, let me know and we can come up with a different solution.

Miika L.
  • 3,333
  • 1
  • 24
  • 35
  • 2
    Differences between nvarchar and varchar are discussed here: http://stackoverflow.com/questions/144283/what-is-the-difference-between-varchar-and-nvarchar – Miika L. Nov 22 '11 at 13:06