<head>
, that is, before the meta tag with information about the page encoding, which is probably not entirely correct.protected function _headerOutput ( ) {
$ collapsed = isset ( $ _COOKIE [ 'ZFDebugCollapsed' ] ) ? $ _COOKIE [ 'ZFDebugCollapsed' ] : 0 ;
return ( '
<style type = "text / css" media = "screen">
...
</ script> </ head> ' ) ;
}
protected function _output ( $ html )
{
...
$ response -> setBody ( preg_replace ( '/ ( <\ / head> ) / i' , '$ 1' . $ this -> _headerOutput ( ) , $ response -> getBody ( ) ) ) ;
...
}
Everything, now<meta http-equiv="content-type" content="text/html; charset=utf-8" />
will appear immediately after the opening<head>
.
ps The problem is also solved if the BOM is forced to be specified at the beginning of the file, but, for example, PHP Storm cannot (at the moment) save it. However, BOM is not necessary for browser applications, it is even redundant, based on the document " Use of BOM is not required for UTF-8 "
Source: https://habr.com/ru/post/103925/
All Articles