XML Parsing - PHP encoding



I have a big XML (>15Mb) and i have to read it, parse it, and store some values in a DB. My problem is, the XML's come in in differents formats (UTF-8, ISO-8859-1).


With UTF-8 no prob. But ISO-8859-1 is giving me huge problems!! The tags come with special charachters which are not parsed correctly by XMLReader and readOuterXML()


Tryed already with, but with no luck



$xml = new XMLReader;
$xml->open($import_file,'ISO-8859-1');


Tried with:



  • utf8_encode

  • mb_convert_encoding($stringXML, 'UTF-8' );

  • iconv("ISO-8859-1", "UTF-8//TRANSLIT", $stringXML);


None of them helped me.


No comments:

Post a Comment