Special characters not working in blocks


I am using the new blocks. I have a page layout with three content areas – ‘banner’, ‘text’ and ‘cta’. In my blueprint, all three area sections are structured the same, albeit with different fieldsets. In the template, all three are set to output in the same way (e.g. <?= $page->banner()->toBlocks() ?>). However, I am suddenly and for no apparent reason experiencing issues with special characters.

I have copied and pasted special characters into the blocks in all three areas and all was working fine until just recently. Everything looks fine in the panel and the special characters in the ‘banner’ section continue to render correctly in the front-end.

But the special characters in the ‘text’ and ‘cta’ areas are now displaying on the page as “’” or “é” depending on the block type. I have looked at the .txt files and similar characters appear in the same unicode format in all three areas (e.g. \u00a0 for an &nbsp;) and yet they are not rendering the same on the page.

Why are special characters now not rendering correctly from only some blocks? Please help.

Many thanks in advance.

Hey and welcome to the forum.

What I’m wondering: What field types (e.g. writer field, simple text field) inside your blocks render correctly and which don’t? In your block snippets, how do you render the fields that render correctly vs. don’t render correctly? Can you see a pattern?

Hi, Sonja. Thanks for the welcome.

I couldn’t see any pattern but the problem has miraculously somehow fixed itself.

It’s been an issue for a couple of days in some but not all instances of the heading, text and list blocks. There’s no difference in set-up between the blocks/areas where the special characters were rendering correctly and those where they were not. I tried recreating pages with new blocks, tried copying content from blocks not working into blocks that were, cleared cache (of course). tried different browsers and could not diagnose the problem. And now, after a random page refresh, everything is back to normal.

Hopefully, just a temporary glitch that’s gone for good but if it comes back I’ll return to the forum.

Many thanks.