I want to open text files and load them into a RichTextBox. This has been going fine so far, but now I'm struggling with an encoding issue.
So I used the GetType() method from this StackOverflow page: How to find out the Encoding of a File? C# - and it returns "System.Text.UnicodeEncoding".
My questions now are:
- How do I convert Unicode (I guess that's what they are, although I haven't double checked) into UTF8 (and possibly backwards)?
- Can I switch the RichTextBox to display Unicode correctly? The following shows awkward results:
rtb.LoadFile(aFile, RichTextBoxStreamType.PlainText);
- How can I define which encoding a SaveFileDialog should use?