当CakePHP传递给MessageFormatter时,我会随机查看CakePHP中与模板文件名字符串相关的Debug Kit中的错误。有时视图加载正常,其他时候失败并带有以下内容:
致命错误:[Aura \ Intl \ Exception \ CannotFormat]无效的UTF-8数据 字符串参数: ' /Users/daniel/cakebox/Apps/mycake3/src/Template/Error/error500.ctp' ;: U_ILLEGAL_ARGUMENT_ERROR
#0 /Users/daniel/cakebox/Apps/mycake3/vendor/cakephp/cakephp/src/I18n/Formatter/IcuFormatter.php(51): Cake \ I18n \ Formatter \ IcuFormatter-> _formatMessage(' en_US','渲染 {0}',数组)
#1 /Users/daniel/cakebox/Apps/mycake3/vendor/aura/intl/src/Aura/Intl/Translator.php(142): Cake \ I18n \ Formatter \ IcuFormatter->格式(' en_US','渲染{0}',数组)
#2 /Users/daniel/cakebox/Apps/mycake3/vendor/cakephp/cakephp/src/I18n/functions.php(81): Aura \ Intl \ Translator->翻译('渲染{0}',数组)
#3 /Users/daniel/cakebox/Apps/mycake3/vendor/cakephp/debug_kit/src/Panel/TimerPanel.php(85): __d(' debug_kit','呈现{0}',' /用户/ daniel / c ...')
#4 /Users/daniel/cakebox/Apps/mycake3/vendor/cakephp/cakephp/src/Event/EventManager.php(409): DebugKit \面板\ TimerPanel-> DebugKit \面板{闭合}(对象(蛋糕\事件\事件), ' / Users / daniel / c ...')
#5 / Users / daniel / cakebox / Apps / m in /Users/daniel/cakebox/Apps/mycake3/vendor/cakephp/cakephp/src/Error/ErrorHandler.php 第156行
我已尝试过多种调试选项,但我无法解决问题所在?字符串对我来说很好,并且被mb_check_encoding确认为UTF-8($ string,' UTF-8');