Cyrillic encoding in C#

Viewed 21811

I have a bunch of Cyrillic-like text in a MSSQL database and need to convert it to Cyrillic in C#.

So... Ðàáîòà â ãåðìàíèè

should become

Работа в германии

Any suggestions?

I should add that the closest I've gotten is ?aaioa a aa?iaiee

Here's the code I'm using:

 str = Encoding.UTF8.GetString(Encoding.GetEncoding("Windows-1251").GetBytes(drCurrent["myfield"].ToString()));
 str = Encoding.GetEncoding(1251).GetString(Encoding.Convert(Encoding.UTF8, Encoding.GetEncoding(1251), Encoding.UTF8.GetBytes(str)));
2 Answers
Related