Skip to content

Commit 4046e83

Browse files
committed
Test for double charset conversion fix
1 parent c0a436f commit 4046e83

File tree

2 files changed

+16
-0
lines changed

2 files changed

+16
-0
lines changed

tests/DomTest.php

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,14 @@ public function testIncorrectContentType()
4141
$this->assertEquals($a->text, 'click here');
4242
}
4343

44+
public function testCharsetConvertInAttribute()
45+
{
46+
$dom = new Dom;
47+
$dom->loadFromFile(__DIR__ . '/files/ISO-8859-7.html', ['preserveLineBreaks' => true]);
48+
$a = $dom->find('a', 0);
49+
$this->assertEquals('/testη', $a->href);
50+
}
51+
4452
public function testLoadSelfclosingAttr()
4553
{
4654
$dom = new Dom;

tests/files/ISO-8859-7.html

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
<html>
2+
<head>
3+
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-7">
4+
</head>
5+
<body>
6+
<a href="/testç">EEç<span>XX</span></a>
7+
</body>
8+
</html>

0 commit comments

Comments
 (0)