リッチ テキスト ボックスのテキストをエンコードしようとしているので、UTF-8
.
しかし、いくつかの問題があり、ほとんどのオンライン ヘルプの投稿では、変換されたテキストをリッチテキスト ボックスに戻す方法が示されていません。
private void encodeToolStripMenuItem_Click(object sender, EventArgs e)
{
UTF8Encoding utf8 = new UTF8Encoding();
string textstring;
string encodedString;
textstring = richTextBox1.Text;
byte[] encodedBytes = utf8.GetBytes(textstring);
richTextBox1.Clear();
encodedBytes.ToString(encodedString);
richTextBox1.Text = encodedString;
}