gpt4 book ai didi

c# - 我们如何在xml中保存特殊符号

转载 作者:太空宇宙 更新时间:2023-11-03 11:53:31 24 4
gpt4 key购买 nike

我正在将“ child 音乐和视频”保存到 xml

所以我用下面的代码来转换特殊符号

        string str = "Children’s Music & videos";
string temp = HttpUtility.HtmlEncode(str);

但保存编码值后,xml 不可读。我怎样才能将这个特殊符号保存到 xml

谢谢,

最佳答案

如果您在字符串中有正确的文本作为开头,使用普通的 XML API 应该可以为您正确编码所有内容。

我猜你的字符串中有错误的文本。看我的Debugging Unicode Problems文章的建议。

关于c# - 我们如何在xml中保存特殊符号,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/1389882/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com