ZF-3938: Set and retrieve document encoding in Zend_Dom_Query

Issue Type: Improvement Created: 2008-08-12T14:31:04.000+0000 Last Updated: 2010-10-08T07:06:15.000+0000 Status: Resolved Fix version(s): - 1.11.0 (02/Nov/10)

Reporter: Adam Jensen (jazzslider) Assignee: Matthew Weier O'Phinney (matthew) Tags: - Zend_Dom_Query

Related issues: Attachments:


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:

<pre class="highlight">
// Assign encoding at construction
$queryObject = new Zend_Dom_Query($string, 'utf-8');

// Assign encoding through mutator

// Assign encoding in setDocument*() methods
$queryObject->setDocument($string, 'utf-8');
$queryObject->setDocumentHtml($string, 'utf-8');
// etc.

// Retrieve current encoding
echo $queryObject->getEncoding(); // utf-8


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.

Have you found an issue?

See the Overview section for more details.


© 2006-2016 by Zend, a Rogue Wave Company. Made with by awesome contributors.

This website is built using zend-expressive and it runs on PHP 7.