converting unicode to actual character C# [duplicate]

心不动则不痛 提交于 2019-12-20 03:16:24

问题


I have a string "Some string that I am using but Poacher\u2019s shows unicode!" I'm trying to have the Unicode convert into the ' character.


回答1:


Something like that should work :

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

Please see the Encoding class on MSDN.



来源:https://stackoverflow.com/questions/36611182/converting-unicode-to-actual-character-c-sharp

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!