I’m using MySQL Connector .NET to get some rows from database. Coding in connection is set to UTF8. It gets all rows, then it prints it row by row through events. In the end there is a piece of code:
this.BeginInvoke((Action)delegate()
{
this.messages.Text += Environment.NewLine + message;
// this.messages is a RichTextBox
});
All adds fine, but when the message is for instance aaarrtoń it changes the font since that sign from Courier New to the default. It always changes the font since the sign ń (it’s polish letter). It is pretty weird because if I write it by hand in the RichTextBox its all fine.
I suspect Encoding problem but if I read the data in UTF-8 Encoding it should be all ok right?
After all I’ve found a solution. In the
RichTextBoxproperties I set:I have found it somewhere and surprisingly that works.