Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/csharp/291.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# VS2017解析错误XAML特殊字符实体_C#_Xml_Xaml_Encoding_Visual Studio 2017 - Fatal编程技术网

C# VS2017解析错误XAML特殊字符实体

C# VS2017解析错误XAML特殊字符实体,c#,xml,xaml,encoding,visual-studio-2017,C#,Xml,Xaml,Encoding,Visual Studio 2017,在VS2017编译器中,当我在XAML文件上使用空间字符时,出现了此错误,例如: <Label Grid.Row="0" Grid.Column="0" Name="lblProductLineName" Content="Línea de Producto"/> 编译时,我遇到了以下错误: 错误=>'给定编码中的无效字符。第26行,位置 87.“XML无效 我在VS2010上打开了这个项目,但没有那个错误。 我正在尝试更改为使用如下HTML格式 <Label Grid.

在VS2017编译器中,当我在XAML文件上使用空间字符时,出现了此错误,例如:

<Label Grid.Row="0" Grid.Column="0" Name="lblProductLineName" Content="Línea de Producto"/>

编译时,我遇到了以下错误:

错误=>'给定编码中的无效字符。第26行,位置 87.“XML无效

我在VS2010上打开了这个项目,但没有那个错误。 我正在尝试更改为使用如下HTML格式

<Label Grid.Row="0" Grid.Column="0" Name="lblProductLineName" Content="L&iacute;nea de Producto"/>

但是当我看到te用户界面时,没有显示正确的字符 它必须是“í
有人能帮我吗?

你可以使用unicode版本的特殊字符。就你而言:

<TextBlock Text="Test &#x00CD;"/>


Wikipedia对unicode版本的特殊字符有很好的参考:

这个文件的实际编码是什么(例如用记事本++)以及
声明中作为
encoding=“blah”
?我使用VSCOde编辑.xaml文件,但里面没有任何编码标记。好的,当你用notepad++打开文件并检查实际编码时?你看到了什么?Thaks,但我正试着这么做。但是我得到了这个“Lí;nea”。@D.Hurtado如果我得到了正确的答案,你会看到
Lí;nea
您在哪里输入了
L�CD;nea
这将清楚地表明编码端正在工作。因此,我感觉您在阅读此XML时不需要重新编码。如何读取XML?