File tree Expand file tree Collapse file tree 2 files changed +9
-0
lines changed Expand file tree Collapse file tree 2 files changed +9
-0
lines changed Original file line number Diff line number Diff line change @@ -594,6 +594,14 @@ protected function detectCharset()
594594 $ encode ->from ($ this ->defaultCharset );
595595 $ encode ->to ($ this ->defaultCharset );
596596
597+ if ( ! is_null ($ this ->options ->enforceEncoding ))
598+ {
599+ // they want to enforce the given encoding
600+ $ encode ->from ($ this ->options ->enforceEncoding );
601+ $ encode ->to ($ this ->options ->enforceEncoding );
602+ return false ;
603+ }
604+
597605 $ meta = $ this ->root ->find ('meta[http-equiv=Content-Type] ' , 0 );
598606 if (is_null ($ meta ))
599607 {
Original file line number Diff line number Diff line change @@ -11,6 +11,7 @@ class Options {
1111 protected $ defaults = [
1212 'whitespaceTextNode ' => true ,
1313 'strict ' => false ,
14+ 'enforceEncoding ' => null ,
1415 ];
1516
1617 /**
You can’t perform that action at this time.
0 commit comments