I Can't Write Arabic text in the XAML file

2020-04-07 11:03发布

<TextBlock Text="المبلغ" />

when i built the project the following error happened:

enter image description here

any help....

3条回答
萌系小妹纸
2楼-- · 2020-04-07 11:36

To Change the encoding try this

var pi = xmldoc.createProcessingInstruction("xml",
                                " version='1.0' encoding='UTF-8'");
xmldoc.appendChild(pi);

Check out the link below. http://msdn.microsoft.com/en-us/library/aa468560.aspx

查看更多
smile是对你的礼貌
3楼-- · 2020-04-07 11:51

Change the XAML file encoding to "UTF-8" , you can use Visual Studio to Save File As and then change the encoding.

查看更多
家丑人穷心不美
4楼-- · 2020-04-07 12:00

The problem is clear, you have a problem with your file encoding, If am not mistaken the word in the Text property up there is an Arabic keyword which requires Unicode encoding. Change your file encoding to Unicode, by doing the following:

Open the XAML file you have problem with, go to File > Save As

enter image description here

Click on the small down arrow at the save button to select the encoding

enter image description here

Select Unicode save and replace your old file.

enter image description here

This should solve your problem.

查看更多
登录 后发表回答