我正在使用 C# 2010,想将 textBox2.Text 转换为 UTF8 字符串...
byte[] utf = System.Text.Encoding.UTF8.GetBytes(textBox2.Text);
byte[] utf8Bytes = Encoding.UTF8.GetBytes(textBox2.Text);
String str = Encoding.UTF8.GetString(utf8Bytes);
// MessageBox.Show(str);
//sTopicNewsTxt = "-1 RENDERER*TREE*@TOP_NEWS_DATA01*GEOM*TEXT SET " + Encoding.UTF8.GetString(utf8Bytes);
//MessageBox.Show(sTopicNewsTxt);
UTF8Encoding utf8 = new UTF8Encoding();
//byte[] var = utf8.GetBytes(textBox2.Text);
sTopicNewsTxt = "-1 RENDERER*TREE*@TOP_NEWS_DATA01*GEOM*TEXT SET " + Convert.ToString(utf[0]);
我正在使用印地语 utf8 字体...
感谢和问候。