Database Administrators Stack Exchange is a question and answer site for database professionals who wish to improve their database skills and learn from others in the community. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I've a Rails-Application, which reads data from a Microsoft SQL Server 2008 R2 Database.

All umlauts are represented by a '?', so I checked the encoding of the database. The encoding is 'Latin 1'. When I try to change it, I have a big list of different collations, but UTF-8 is not listed. The rails application communicates with the database using an ODBC DSN, could this be the source of the problem?

How can I change the database collation to UTF-8?

share|improve this question

Encoding? Do you mean collation? The collation only affects things like equality tests, sort order, etc. They don't affect the allowed encodings for column values.

If you want to store unicode text, you should make sure your columns are among

  • NTEXT (2-byte characters)

rather than

  • CHAR
  • TEXT (1-byte characters).
share|improve this answer
Many thanks for you're answer. But I've also data stored in nvarchar-columns, and they'll also aren't represented correctly. May my Rails-app is the source of the problem. – Beastcraft Jan 11 '12 at 8:27
That's interesting. I'm not familiar enough with Rails to know how the string handling and ODBC APIs work, but the two-byte characters are probably throwing it off somehow. – db2 Jan 11 '12 at 13:05
Note: text and ntext are deprecated -- instead, use varchar(MAX) and nvarchar(MAX) respectively. – Jon Seigel Sep 14 '12 at 16:54

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.