wat*_*rif 1 c# unicode character-encoding codepages
我通过使用代码页windows-1251从文件中读取字符串"ñîôč˙",而不是使用iso-8859-2.它应该是一些西里尔字符串.如何在C#中实现以下功能:
string res = Recover("?îô??");
string Recover(string input)
{
???
}
Run Code Online (Sandbox Code Playgroud)
res是西里尔字符串,如果我在第一时间阅读文件时使用了良好的页面,我会得到它.
脱离我的头顶..
string Recover(string input)
{
return Encoding.GetEncoding("iso-8859-2").GetString(Encoding.GetEncoding(1251).GetBytes(input));
}
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
631 次 |
| 最近记录: |