问题
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!
回答1:
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
来源:https://stackoverflow.com/questions/7846404/xml-encoding-and-jquery-parsing