[Project_owners] Changing the encoding of a XMLHttpRequest object's response

Sudhakar Chandra thaths at openscroll.org
Tue Nov 9 12:17:38 EST 2004


Hi,

I am working on a XUL News Aggregator [1] for Mozilla and Firefox. I use
XMLHttpRequest to download the RSS/Atom/XML feed. How do I change the 
encoding of the responseXML into utf-8 and save the downloaded content 
into a file?

For example, http://news.pathfinder.gr/rss/scitech/news.xml has the
following header telling me what the encoding is:

<?xml version="1.0" encoding="iso-8859-7" standalone="yes" ?>

I can get the iso-8859-7 encoding through 
XMLHttpRequest.responseXML.characterSet. I want to convert this into 
UTF-8 and save it to a file.  Can you give me a code snippet to do this?

Thanks.

Thaths
-- 
Person A: If you don't like America why don't you move somewhere else?
Person B: What? And become a victim of America's foreign policy?
Slacker Without Borders                        http://openscroll.org/
Key fingerprint = 8A 84 2E 67 10 9A 64 03  24 38 B6 AB 1B 6E 8C E4



More information about the Project_owners mailing list