RichTextBox.RTF setter throwing System.ArgumentException. File format is not valid in Windows version 1803
Asked Answered
F

1

1

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

Forceful answered 23/4, 2019 at 10:35 Comment(0)
F
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

Forceful answered 30/4, 2019 at 19:12 Comment(1)
What is the work-around? I can't see any on the page your linked.Lynnelle

© 2022 - 2024 — McMap. All rights reserved.