-
-
Notifications
You must be signed in to change notification settings - Fork 374
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
Error: DOMElement::setAttribute(): string is not in UTF-8 #491
Comments
As Line 58 is trying to set the file name attribute of the context node, the problem must reside within the path or name of the file currently being worked on. Can you provide the stripped down example with a the problematic file name so a fix can be considered? Based on the backslashes within the error message, I presume this is on windows? |
Hi!
|
Hi, Changing line 170 in Clover.php to |
There are likely various places where encoding issues might cause this error. As for now, the problem seems to have occured on line 58 and 170. While using To fix this, we should probably incorporate a more sophisticated conversion. That would probably require iconv and/or mbstring to be present though. @sebastianbergmann What do you think? |
@theseer I have no problem with requiring iconv and/or mbstring if that is what it takes to properly solve this issue. |
I am experiencing the same problem in a legacy project encoded in iso-8859-1. I'm using phpunit 9.5.20 and php-code-coverage 9.2.15 in linux. The exact error when I run: bin/phpunit --log-junit report.xml --debug Is: Test 'Namespaces\Filename::testSOmething with data set "Uppercase - red�marrer" ('RED�MARRER')' started |
@sebastianbergmann Can we reopen this issue? I'll try to come up with a fix next week. |
Generating code coverage report in Clover XML format ...
Warning: DOMElement::setAttribute(): string is not in UTF-8 in ...\vendor\phpunit\php-code-coverage\src\Report\Clover.php on line 58
Versions:
phpunit.xml.dist:
The text was updated successfully, but these errors were encountered: