【问题标题】:converting unicode to actual character C# [duplicate]将unicode转换为实际字符C# [重复]
【发布时间】:2016-04-13 23:17:00
【问题描述】:

我有一个字符串“我正在使用的一些字符串,但 Poacher\u2019s 显示 unicode!”我正在尝试将 Unicode 转换为 ' 字符。

【问题讨论】:

标签: c# unicode decoding


【解决方案1】:

类似的东西应该可以工作:

string text = "Some string that I am using but Poacher\u2019s shows unicode!";
byte[] textBytes = Encoding.Unicode.GetBytes(text);
Encoding.UTF8.GetString(Encoding.Convert(Encoding.Unicode, Encoding.UTF8, textBytes));

请参阅 MSDN 上的 Encoding 课程。

【讨论】:

  • 这正是我想要的,谢谢
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2017-01-29
  • 2020-01-21
  • 2018-06-08
  • 2016-02-25
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多