将文本转换为UTF8 [英] convert text to UTF8
本文介绍了将文本转换为UTF8的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
hii
请帮我
我需要用C#中的代码将文本转换为UTF8吗?
hii
plz can help me
i need code in c# to convert text to UTF8?
推荐答案
Rich引起了我的注意:将文本转换为UTF8".
对我来说,这表明您需要对Unicode的工作原理和UTF是什么有所了解.只是一个提示:许多人说Unicode是16位代码.这不是真的.实际上,代码点的数量远不止于此,并且每个UTF(甚至UTF-16:-,这很矛盾)都同时支持它们.
因此,对 http://unicode.org/ [ http://www.unicode.org/faq//utf_bom.html [
Rich brought my attention to the word: "convert text to UTF8".
To me, it is some indication of the fact that you need to get some understanding on how Unicode works and what the UTFs are. Just a hint: many said Unicode is a 16-bit code. This is not true. Actually, the number of code points is much more than that and each and every UTF (even UTF-16 :-), what a paradox) support them all at the same time.
Therefore, it is important to get introduced to http://unicode.org/[^].
See also:
http://www.unicode.org/faq//utf_bom.html[^].
—SA
System.Text.Encoding utf_8 = System.Text.Encoding.UTF8;
string s = "unicode";
//string to utf
byte[] utf = System.Text.Encoding.UTF8.GetBytes(s);
//utf to string
string s2= System.Text.Encoding.UTF8.GetString(utf);
将来祝您好运.
Good luck in the future.
您尝试搜索吗?一个简单的搜索将为您找到答案.
P.S.我自己做了,很快就得到了答案...
Did you try searching? A simple search will get you the answer to this.
P.S. I just did it myself and got the answer very quickly...
这篇关于将文本转换为UTF8的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文