ZF-3938: Set and retrieve document encoding in Zend_Dom_Query
Description
It would be useful to be able to set and/or retrieve the encoding used to interpret the underlying document in Zend_Dom_Query. Some possible use cases:
// Assign encoding at construction
$queryObject = new Zend_Dom_Query($string, 'utf-8');
// Assign encoding through mutator
$queryObject->setEncoding('utf-8');
// Assign encoding in setDocument*() methods
$queryObject->setDocument($string, 'utf-8');
$queryObject->setDocumentHtml($string, 'utf-8');
// etc.
// Retrieve current encoding
echo $queryObject->getEncoding(); // utf-8
Comments
Posted by Sasa Stamenkovic (umpirsky) on 2009-09-22T06:15:50.000+0000
I have problems with encoding, after querying some html with Zend_Dom_Query Serbian chars (š.č,ć...) are messed, any idea how to fix this?
Posted by Alexander (sashko) on 2009-10-03T16:36:53.000+0000
I have problems with decode too. When Zend_Dom_Query recive utf text with russian chars, He return not readable text. Any combinations with iconv did't have result. Check please your plugin.
Posted by Dolf Schimmel (Freeaqingme) (freak) on 2010-10-06T11:18:48.000+0000
Matthew, any update?
Posted by Matthew Weier O'Phinney (matthew) on 2010-10-08T07:06:13.000+0000
Added capabilities as described in the issue to trunk; will release with 1.11.0; please test.