Jump to content

XML problem with UTF-8/Spanish and PHP


Guest DRK

Recommended Posts

I started using XML some days ago and don't know too much things.Here is my problem:I'm using PHP to get the data from a mysql table and then transform it intoxml code.The language set in the table is utf8_general_When i try to output the xml file, firefox translates the "Ñ" or "ñ" if you can't see it...but IE gives an error and stops loading the rest of the document, so i can't load the datain my "ajax" test.I'm using htmlentities() on PHP to translate the "strange characters".There's a sample of the code at --> http://www.marukatsusp.com/ajax/test3.php (XML part)--> http://www.marukatsusp.com/ajax/test3.html (html part)I didn't know where to post this topic, i thought it's an issue related with XML.

Link to comment
Share on other sites

You might want to try putting this header in the file if you're using AJAX to access it:<?php header("Content-type: application/xml;charset=ISO-8859-1"); ?>+And instead of <?xml version="1.0" encoding="utf-8"?> try <?xml version="1.0" encoding="iso-8859-1"?>UTF-8 doesn't support spanish characters.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...