I have a bunch of Cyrillic-like text in a MSSQL database and need to convert it to Cyrillic in C#.
So... Dàá?òà a ??eìàíèè
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)));
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…