File tree Expand file tree Collapse file tree 3 files changed +14
-1
lines changed Expand file tree Collapse file tree 3 files changed +14
-1
lines changed Original file line number Diff line number Diff line change 17
17
"php" : " >=5.3" ,
18
18
"react/event-loop" : " ~0.4.0|~0.3.0" ,
19
19
"clue/buzz-react" : " ~0.2.0" ,
20
- "ext-simplexml" : " *"
20
+ "ext-simplexml" : " *" ,
21
+ "neitanod/forceutf8" : " ~1.4"
21
22
},
22
23
"require-dev" : {
23
24
"clue/block-react" : " ~0.1.0"
Original file line number Diff line number Diff line change @@ -26,6 +26,9 @@ public function loadXmlFile($path)
26
26
27
27
public function loadXmlString ($ html )
28
28
{
29
+ // log output often uses garbled ISO-8859-1 and UTF-8 encodings
30
+ $ html = \ForceUTF8 \Encoding::toUTF8 ($ html );
31
+
29
32
// fix invalid markup of outdated ViewVC versions
30
33
// - help link in footer not terminated
31
34
// - selected branch/tag in CVS "sticky tag" dropdown has not attribute value
Original file line number Diff line number Diff line change @@ -39,6 +39,15 @@ public function testHtmlEntities()
39
39
$ this ->assertEquals ('ä… © ' , (string )$ xml );
40
40
}
41
41
42
+ public function testMixedEncodings ()
43
+ {
44
+ // mixed UTF-8 and ISO-8859-1
45
+ $ str = "<p>ä and \xFC</p> " ;
46
+ $ xml = $ this ->loader ->loadXmlString ($ str );
47
+
48
+ $ this ->assertEquals ('ä and ü ' , (string )$ xml );
49
+ }
50
+
42
51
public function testLoadInvalidMarkupInputNotClosed ()
43
52
{
44
53
$ str = '<input type="hidden"> ' ;
You can’t perform that action at this time.
0 commit comments