问题
The following scenario is simulated to reproduce the crash:
- Enable Beta: unicode UTF-8 for world wide language support (To enable Start=> Region & Language settings => Related settings -> Additional date, time & regional settings => Region -> Change date, time or number formats => select Administrative tab => Click on Change System Locale.
- Check Beta: unicode UTF-8 for world wide language support checkbox
- Restart the system
In Windows forms Application => Add a form, RichTextBox, Button and a label OnButtonClick => add below lines
richTextBox1.SelectAll(); richTextBox1.Rtf = richTextBox1.SelectedRtf; //Leads Crash System.ArgumentException: File format is not valid. label1.Text = "RichTextBox1.Rtf = " + richTextBox1.Rtf;
If we UnCheck Beta: unicode UTF-8 for world wide language support, and restart the system there was no issue.
Issue is observed with windows version 1803
Any help on this use case is appreciated
回答1:
It is an issue from microsoft build 1803 and 1809 as well. Work around solution can be found here.
https://developercommunity.visualstudio.com/content/problem/544623/issue-caused-by-unicode-utf-8-for-world-wide-langu.html
来源:https://stackoverflow.com/questions/55809339/richtextbox-rtf-setter-throwing-system-argumentexception-file-format-is-not-val