I have a method that converts strings to RTF-Strings.
For that i use the RichTextBox
wich is provided by .NET the way it is described here:
How to convert a string to RTF in C#?
When I enter ő
it returns {\rtf1 {'f5\f1}}
. But that seems to be õ
because I get that symbol, when I put it into a .rtf-file.
Why does that happen? And what can i do to solve this issue?
EDIT:
Here is the whole Method as i use it:
private static string ConvertToRtf(string text) {
System.Windows.Forms.RichTextBox richTextBox = new System.Windows.Forms.RichTextBox();
richTextBox.Text = text;
int offset = richTextBox.Rtf.IndexOf(@"\f0\fs17") + 8;
int length = richTextBox.Rtf.LastIndexOf(@"\par") - offset;
string result = richTextBox.Rtf.Substring(offset, length).Substring(1);
return result;
}