奇怪的字符显示在XML> ASP.NET> Javascript> HTML中
i have a script that reads an xml file then produces some document.write javascript lines and sends them to request . I'm getting a weird character (only shows in internet explorer, not firefox). I can't seem to track it down.
我有一个脚本,读取一个xml文件,然后生成一些document.write javascript行,并将它们发送给请求。我得到一个奇怪的角色(只在Internet Explorer中显示,而不是firefox)。我似乎无法追踪它。
Here's a URL of the script being used (has weird chars in IE): http://www.voyagertravelguides.com/test.htm
这是使用的脚本的URL(在IE中有奇怪的字符):http://www.voyagertravelguides.com/test.htm
The source of the javascript tag is where the .net script is
javascript标记的来源是.net脚本的位置
Anyone know what's up? I've tried using ISO-8859-1 on both the script and in a meta tag. I've tried replacing chr(194) in the .NET script
谁知道怎么了?我已尝试在脚本和元标记中使用ISO-8859-1。我试过在.NET脚本中替换chr(194)
1 个解决方案
#1
If you use WriteAllText or WriteAllLines to create the xml file, it can introduce odd characters if you don't specify the encoding scheme.
如果使用WriteAllText或WriteAllLines创建xml文件,如果未指定编码方案,则可能会引入奇数字符。
For example, instead of
例如,而不是
File.WriteAllText(fName, sText)
use
File.WriteAllText(fName, sText, System.Text.Encoding.Default)
更多相关文章
- 包含HTML和JavaScript标记的HTML选择控件作为文本
- 如何在详细信息标记的结束事件上添加CSS转换?
- 单击内部标记时将类添加到li
- 如何为给定的地方放置标记
- 使用ng-repeat渲染条件标记
- 使用CSS类作为JS标记是一种不好的做法吗?
- 在Django模板标记库中导入外部库时出错
- python解压zip脚本
- 使用python脚本配置zabbix发送报警邮件