Mantis - Quercus
|
|||||
Viewing Issue Advanced Details | |||||
|
|||||
ID: | Category: | Severity: | Reproducibility: | Date Submitted: | Last Update: |
5586 | minor | always | 11-12-13 13:44 | 11-12-13 13:44 | |
|
|||||
Reporter: | JFM | Platform: | |||
Assigned To: | OS: | ||||
Priority: | normal | OS Version: | |||
Status: | new | Product Version: | 4.0.36 | ||
Product Build: | Resolution: | open | |||
Projection: | none | ||||
ETA: | none | Fixed in Version: | |||
|
|||||
Summary: | 0005586: DomDocument UTF-8 Encoding problem | ||||
Description: |
Quercus War 4.0.37 java version "1.7.0_40" |
||||
Steps To Reproduce: | |||||
Additional Information: |
import java.io.IOException; import javax.script.ScriptEngine; import javax.script.ScriptException; import org.w3c.dom.Document; import org.w3c.dom.ProcessingInstruction; import org.xml.sax.SAXException; import com.caucho.quercus.QuercusEngine; import com.caucho.xml.AbstractParser; import com.caucho.xml.Xml; public class QuercusTest { private static ScriptEngine engine; public static void main(String[] args) throws ScriptException, IOException { String xml = "<?xml version=\"1.0\" encoding=\"UTF-8\"?> &0000937; é ";Document doc; try { doc = new Xml().parseDocumentString(xml); System.out.println(doc.getTextContent()); } catch (SAXException e) { // TODO Auto-generated catch block e.printStackTrace(); } QuercusEngine engine = new QuercusEngine(); //NOTE: add WEB-INF/classes/META-INF/services/com.caucho.quercus.QuercusModule to classpath engine.getQuercus().init(); engine.execute("<?php " + "$dom = new DOMDocument();" + "$dom->loadXML('<?xml version=\"1.0\" encoding=\"UTF-8\"?> &0000937; ');"+ "output($dom);" + "$dom->loadXML(' &0000937; ');"+ "output($dom);" + "$dom->loadXML(' &0000937; é ');"+ "$dom->encoding = \"UTF-8\";" + "output($dom);" + "$dom = new DOMDocument();" + "$dom->appendChild($dom->createTextNode('&0000937;'));" + "output($dom);" + "$dom = new DOMDocument('1.0', 'UTF-8');" + "$dom->appendChild($dom->createTextNode('&0000937;'));" + "output($dom);" + "$dom = new DOMDocument('1.0', 'ISO-8859-1');" + "$dom->appendChild($dom->createTextNode('&0000937;'));" + "output($dom);" + "$dom = new DOMDocument('1.0', 'ISO-8859-1');" + "$dom->loadXML('<?xml version=\"1.0\" encoding=\"UTF-8\"?> &0000937; ');"+ "output($dom);" + "function output($dom){" + " print 'encoding: ' . $dom->encoding . \"\n\";" + " print $dom->saveXML() . \"\n\";" + "}" ); /* engine.execute("<?php " + "$xml = new DOMDocument;" + "$xml->load($file);" + "$xsl = new DOMDocument;" + "$xsl->load($xslfile);" + "$proc = new XSLTProcessor;" + "$proc->importStyleSheet($xsl); " + "echo $proc->transformToXML($xml);" ); */ } } |
||||
Relationships | |||||
Attached Files: |
There are no notes attached to this issue. |