Handling Content Encoding in PHP XML

Use the iconv library to convert it before passing it into an XML extension:

$utf_8 = iconv('ISO-8859-1', 'UTF-8', $iso_8859_1);

Then convert it back when you are finished:

$iso_8859_1 = iconv('UTF-8', 'ISO-8859-1', $utf_8);
Share Article/Example:
  • DotNetKicks
  • DZone
  • StumbleUpon
  • Print
  • Add to favorites
  • Digg
  • del.icio.us
  • Twitter
  • Facebook
  • LinkedIn
  • Posterous
  • Slashdot

 

 
eXTReMe Tracker