Forums » Requests and Feedback » Query Loop Encoding Problem

  • Hello,

    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 “š” and they are transformed to “Å¡”.

    But on admin page, and on single article page, everything is OK.

    For fixed it, I needed to add this code :

    function custom_pre_render_block_filter($block_content, $block) {
    if ($block['blockName'] === 'core/post-content') {
    // Convertir les caractères spéciaux en entités HTML
    $block_content = mb_convert_encoding($block_content, 'HTML-ENTITIES', 'UTF-8');
    }
    return $block_content;
    }
    add_filter('render_block', 'custom_pre_render_block_filter', 10, 2);


    Do you have any idea ?
    I think is probably a Javascript render encode problem ?

    Thank you!

Viewing 1 replies (of 1 total)
  • threadi

    (@threadi)

    I can’t reproduce this in my case. I have a fresh WordPress 6.2 installation, I put the character you mentioned in a post (along with other letters), created a query loop in a page and used the post content block in it. The characters are displayed correctly in both backend and frontend.

    Do you still have plugin enabled in your project? Deactivate them as a test.

    Which theme do you use? I have tested it with TwentyTwentyThree.

Viewing 1 replies (of 1 total)
  • The topic ‘Query Loop Encoding Problem’ is closed to new replies.