windows - RichTextBox.RTF 设置器抛出 System.ArgumentException。文件格式在 Windows 版本 1803 中无效
问题描述
模拟以下场景重现崩溃:
- 启用Beta:unicode UTF-8 以支持全球语言(启用开始 => 区域和语言设置 => 相关设置 -> 其他日期、时间和区域设置 => 区域 -> 更改日期、时间或数字格式 => 选择管理选项卡 => 单击更改系统区域设置。
- Check Beta: unicode UTF-8 for worldwide language support 复选框
- 重启系统
在 Windows 窗体 Application => 添加窗体、RichTextBox、Button 和标签 OnButtonClick => 添加以下行
richTextBox1.SelectAll(); richTextBox1.Rtf = richTextBox1.SelectedRtf; //Leads Crash System.ArgumentException: File format is not valid. label1.Text = "RichTextBox1.Rtf = " + richTextBox1.Rtf;
如果我们取消选中 Beta: unicode UTF-8 for worldwide language support,然后重新启动系统就没有问题了。
Windows 版本 1803 出现问题
对此用例的任何帮助表示赞赏
解决方案
这也是 microsoft build 1803 和 1809 的问题。可以在此处找到解决方案。
推荐阅读
- azure - 使用 ARM 模板启用对 REST API 的 API 管理访问
- python - 当我们在终端python中输入时如何在窗口中继续运行游戏
- ruby-on-rails - FactoryBot 不会在 trait 中触发回调
- r - R组合数据框前两行的字符
- javascript - 检查没有茉莉花的 Jest 的“afterEach”中的测试是否失败
- solr - 使用 Solr 进行自由文本搜索
- java - 来自 MainActivity 的 Foregound Service 启动操作
- python - 如何解释这种 NumPy 索引:a[2::2, ::2]?
- r - 如何在 Stata 中将变量制成表格以显示样本中的所有值,即使它们尚未在数据集中?
- cron - Airflow:有没有一种方法可以让我每分钟使用 CRON 表达式在第 35 秒触发作业?