gutenberg
gutenberg copied to clipboard
JSON file is partiary garbled when exporting my pattern containing the special character ©.
Description
Not all special characters were checked, but besides ©, ® can also be reproduced.
When creating a pattern with some blocks containing ©, the exported JSON file fails to import.
Export JSON file sample
{
"__file": "wp_block",
"title": "test",
"content": "<!-- wp:paragraph {\"align\":\"center\"} -->\n<p class=\"has-text-align-center\">� Theme</p>\n<!-- /wp:paragraph -->",
"syncStatus": "unsynced"
}
Step-by-step reproduction instructions
- Put footer-01.php file in the patterns folder of the TT4 child theme
- Insert a pattern in the post → Create Pattern (either synchronous or asynchronous)
- Site Editor → Patterns → My Patterns → Export as JSON
/patterns/footer-01.php
<?php
/**
* Title: Footer 01
* Slug: twentytwentyfour/footer-01
* Categories: footer
*/
?>
<!-- wp:paragraph {"align":"center"} -->
<p class="has-text-align-center"><?php echo esc_html( '© ' . get_bloginfo( 'name' ) ); ?></p>
<!-- /wp:paragraph -->
Screenshots, screen recording, code snippet
https://github.com/WordPress/gutenberg/assets/15373114/be658588-6df3-4d0a-a1c5-2f2b966269e9
Environment info
WP 6.4.1 TT4 child theme
Please confirm that you have searched existing issues in the repo.
Yes
Please confirm that you have tested with all plugins deactivated except Gutenberg.
Yes
Thanks for reporting the bug!
I believe this was fixed in https://github.com/WordPress/gutenberg/pull/55912, but it hasn't rolled out in a WordPress or Gutenberg release yet.