且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

Symfony2从控制器响应中删除UTF-8 BOM

更新时间:2023-11-19 19:11:34

著名的UTF-8 BOM已由PEAR下的LocalizeRoute.php树枝扩展添加.在我的特殊情况下,它接缝了Symfony通过该文件过滤所有响应的过程,将BOM表块添加到已交付的每个页面中.从LocalizeRoute.php删除BOM足以解决此问题.感谢nifr提出了BOM搜索建议.使用免费的窗口工具WinGrep在整个服务器上运行二进制搜索.非常感谢.

The famous UTF-8 BOM had been added by LocalizeRoute.php twig extension under PEAR. In my particular case it seams Symfony filters all responses through this file, adding the BOM chunk to every page been delivered. Removing the BOM from LocalizeRoute.php was enough to fix the problem. Credits to nifr for suggesting the BOM-search. Used free window's tool WinGrep to run the binary search through the whole server. Thanks a lot.