我在 Magneto 2.3.4 上。里面有vendor/magento/module-checkout/view/frontend/templates/onepage.phtml这样一行: window.checkoutConfig = <?= /* @noEscape */ $block->getSerializedCheckoutConfig() ?>;按照功能,它归结为vendor/magento/module-checkout/Block/Onepage.php::getSerializedCheckoutConfig()并且序列化功能在vendor/magento/framework/Serialize/Serializer/JsonHexTag.php我添加json_last_error_msg()到异常消息中,基本上现在的错误消息是:Exception #0 (InvalidArgumentException): Unable to serialize value. Error:Malformed UTF-8 characters, possibly incorrectly encoded如何快速找到包含错误 UTF-8 字符的结帐配置值或键?或者如何在数据库中快速解决这个问题?
1 回答

月关宝盒
TA贡献1772条经验 获得超5个赞
由于 Magento StackExchange 上的建议,我能够调试并找到有问题的字符。
基本上使用 XDebug 来调试使用 utf8 检查处理的键和值:
mb_detect_encoding($suspiciousString, 'UTF-8', true)
原来是一个错误的加密密钥,我将一些凭据解密为格式错误的字符
- 1 回答
- 0 关注
- 100 浏览
添加回答
举报
0/150
提交
取消