{"id":16726957,"date":"2023-05-10T15:38:16","date_gmt":"2023-05-10T15:38:16","guid":{"rendered":"https:\/\/wordpress.org\/support\/topic\/query-loop-encoding-problem\/"},"modified":"2023-05-10T15:38:16","modified_gmt":"2023-05-10T15:38:16","slug":"query-loop-encoding-problem","status":"publish","type":"topic","link":"https:\/\/wordpress.org\/support\/topic\/query-loop-encoding-problem\/","title":{"rendered":"Query Loop Encoding Problem"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">Hello,<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">I found a bug with Query Loop Gutenberg Block when showing post full content. The returned content is not well encoded. I have some special character like this &#8220;\u0161&#8221; and they are transformed to &#8220;\u00c5\u00a1&#8221;. <br \/><br \/>But on admin page, and on single article page, everything is OK.<br \/><br \/>For fixed it, I needed to add this code :<br \/><br \/><code>function custom_pre_render_block_filter($block_content, $block) {<br \/>if ($block['blockName'] === 'core\/post-content') {<br \/>\/\/ Convertir les caract\u00e8res sp\u00e9ciaux en entit\u00e9s HTML<br \/>$block_content = mb_convert_encoding($block_content, 'HTML-ENTITIES', 'UTF-8');<br \/>}<br \/>return $block_content;<br \/>}<br \/>add_filter('render_block', 'custom_pre_render_block_filter', 10, 2);<\/code><br \/><br \/>Do you have any idea ? <br \/>I think is probably a Javascript render encode problem ?<br \/><br \/>Thank you!<\/p>\n","protected":false},"template":"","class_list":["post-16726957","topic","type-topic","status-publish","hentry","topic-tag-content","topic-tag-encoding","topic-tag-gutenberg","topic-tag-loop","topic-tag-query"],"jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/topic\/16726957","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/topic"}],"about":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/types\/topic"}],"version-history":[{"count":0,"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/topic\/16726957\/revisions"}],"wp:attachment":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/media?parent=16726957"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}