Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unsuspected escaping non ASCI symbols in DOMDocuments comparing result #21

Closed
Ovsyanka opened this issue Aug 13, 2015 · 2 comments
Closed
Labels

Comments

@Ovsyanka
Copy link
Contributor

When i try to compare two DOMDocuments with russian symbols in PHPUnit (which uses this comparator) i have a problem.
Information about encoding lost while comparing documents and in result all russian symbols become encoded like this: <TagName>&#x41F;&#x43E;&#x43B;&#x44C;&#x437;&#x43E;&#x432;&#x430;&#x442;&#x435;&#x43B;&#x44C</TagName> instead of expected <TagName>Пользователь</TagName>
Encoding information lost in DOMNodeComparator::nodeToText. You can see it here:

$xml = '<?xml version="1.0" encoding="utf-8"?><root>тест</root>';
$document = new \DOMDocument;
$document->loadXML($xml);
echo("encoding: " . $document ->encoding . "\n"); // encoding: utf-8
echo("xml: " . $document ->saveXml() . "\n"); // xml: <?xml version="1.0" encoding="utf-8"? ><root>тест</root>
$document->loadXML($document->C14N());
echo("encoding: " . $document ->encoding . "\n"); //encoding:
echo("xml: " . $document ->saveXml() . "\n"); // xml: <?xml version="1.0"? ><root>&#x442;&#x435;&#x441;&#x442;</root>
@stale
Copy link

stale bot commented May 15, 2018

This issue has been automatically marked as stale because it has not had activity within the last 60 days. It will be closed after 7 days if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stale label May 15, 2018
@stale
Copy link

stale bot commented May 22, 2018

This issue has been automatically closed because it has not had activity since it was marked as stale. Thank you for your contributions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant