RichTextBox.RTF setter throwing System.ArgumentExc

2019-08-01 18:55发布

The following scenario is simulated to reproduce the crash:

  1. 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.
  2. Check Beta: unicode UTF-8 for world wide language support checkbox
  3. Restart the system
  4. 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;
    
  5. 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条回答
做个烂人
2楼-- · 2019-08-01 19:51

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

查看更多
登录 后发表回答