I'm on Magneto 2.3.4. In vendor/magento/module-checkout/view/frontend/templates/onepage.phtml
there's a line like this:
window.checkoutConfig = <?= /* @noEscape */ $block->getSerializedCheckoutConfig() ?>;
Following the function, it comes down to vendor/magento/module-checkout/Block/Onepage.php::getSerializedCheckoutConfig()
And the serialize function is in vendor/magento/framework/Serialize/Serializer/JsonHexTag.php
I added json_last_error_msg()
to the exception message, and basically the error message is now:
Exception #0 (InvalidArgumentException):
Unable to serialize value. Error:Malformed UTF-8 characters, possibly incorrectly encoded
How to quickly find the checkout configuration value or key that is having malformed UTF-8 characters? Or how to quickly fix this in database?