xml编码和jquery解析 [英] xml encoding and jquery parsing
问题描述
如果我使用
$ b,那么我在使用jquery中包含swedish chars(åäö)$ b
<?xml version =1.0encoding =UTF-8?>
或
<?xml version =1.0encoding =ISO-8859-1?>
我仍然会在jquery中得到一个parseerror。但是,如果我打开记事本中的文件++并保存utf-8没有BOM它将工作。但这不是一个选择,因为我不能假定所有的用户都会这样做。我该如何解决?谢谢!
您收到的解析错误是什么?
XML文件无法正常工作的最常见问题是由空白引起的,所以也许值得一试。
一个有用的URL是 http://www.usingxml.com/Basics/XmlSpace
谢谢
Im having some trouble reading xml files using jquery that containts swedish chars (åäö) in my xml.
It doesnt matter if i use
<?xml version="1.0" encoding="UTF-8" ?>
or
<?xml version="1.0" encoding="ISO-8859-1"?>
i will still get a parseerror in jquery. However, if i open the files in notepad++ and save with "utf-8 without BOM" it will work. But this is not an option, since i cant assume that all teh users will do that. How do i solve this? Thanks!
What is the parse-error you are receiving?
The most common issue with XML files not working correctly is caused by white space, so maybe worth checking this.
A useful URL is http://www.usingxml.com/Basics/XmlSpace
Thanks
这篇关于xml编码和jquery解析的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!