Special characters output as HTML instead of actual character

Hi lovely community,

I have a few fields in in my blueprints for meta tags, consisting of title, desc, tags and an image. I can type special characters in my local language(æøå), but they’re outputted in html as HTML entities (e.g. ø). I’ve already set utf-8 as the charset.

Here’s an example source code for a blog post. I’m also calling this in my config file:

 return [
    'debug' => true,
    'date.handler' => 'strftime',
    'locale' => 'da_DK.utf8',
    'routes' => [

Am I missing something obvious? Google just tells me to have the locale and charset set.

Thank you in advance!

Best,
Oliver

Hi Oliver,

How do you call the field in the template file? Like that: echo $page->fieldName()->html(); ?

Hi byybora,

Thanks for checking in! I’m calling the field like so:

<?php echo ($page->seodescription()->html()) ?>

I’ve also tried the following:

<?php echo html($page->seodescription()) ?>

With no luck. Let me know if you have an idea of what I’m doing wrong :slight_smile:
Thank you so much!

$field->html() uses htmlentities() function to output.
If you don’t want, you no need to calling ->html().

You can use just:

<?php echo $page->seodescription(); ?>

Ah obviously!! Real blunder here. Thank you so much!