开发者

How to encode into\decode from UTF-8 string in WPF?

开发者 https://www.devze.com 2022-12-29 08:06 出处:网络
So I have a string like Русское Имя how to represent it as real string with wcf textBox? And How to

So I have a string like Русское Имя how to represent it as real string with wcf textBox? And How to encode for example russian string inputed into textInput into UTF-8开发者_JAVA技巧?


To decode this and other HTML encoded strings, use HtmlDecode() like below:

System.Web.HttpUtility.HtmlDecode("Русское Имя")

This decodes to Русское Имя. As for UTF-8, just like bwreichle said, you can use:

Encoding.UTF8.GetBytes(@"Русское Имя")
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号