Flutter Web 波斯语/阿拉伯语字符串未在 UI 上正确显示

问题描述

我刚开始迁移到 Flutter web,刚开始的时候,遇到了这个奇怪的问题。 在代码中使用波斯/阿拉伯字符时,它会在 UI 上显示不正确。其他字符显示很好。

Flutter 认示例应用

environment:
  sdk: ">=2.7.0 <3.0.0"

代码

 children: <Widget>[
            Text(
              'You have pressed the button this many times:',style: Theme.of(context).textTheme.headline4,),Text(
              'شما این دکمه را این تعداد بار فشار داده اید:',Text(
              'ñĚĖĎÆß',Text(
              '$_counter',],

项目和系统编码设置为 UTF-8。

结果:

enter image description here

解决方法

它在 dartpad https://dartpad.dev/1904b824b83992867a0778a5a95f17f1 上工作正常吗?

您是否设置了错误的页面编码,它必须是 utf-8