Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

UTF-8 characteres not showing correctly #122

Closed
siempay opened this issue Aug 8, 2018 · 7 comments · Fixed by #159
Closed

UTF-8 characteres not showing correctly #122

siempay opened this issue Aug 8, 2018 · 7 comments · Fixed by #159

Comments

@siempay
Copy link

siempay commented Aug 8, 2018

I am using this
SEOMeta::setDescription("les entreprises dans leur quête de performance, grâce à ses solutions d’amélioration de la qualité de vie et de fidélisation des salariés");

but I get this in page source code:
<meta name="description" content="les entreprises dans leur qu&ecirc;te de performance, gr&acirc;ce &agrave; ses solutions d&rsquo;am&eacute;lioration de la qualit&eacute; de vie et de fid&eacute;lisation des salari&eacute;s">

@reasecret
Copy link

Same here...

@siempay
Copy link
Author

siempay commented Aug 15, 2018

@reasecret, the problem looks like it is coming from this {!! SEO::generate() !!}.
this displays HTML Code in blade but it parse the non-UTF8 characters
So a better way is to change this {!! SEO::generate() !!} to {!!html_entity_decode(SEO::generate())!!}

@reasecret
Copy link

I've removed htmlentities function from SEOMeta.php (on line 254). Now looks like no problem for me.

@siempay
Copy link
Author

siempay commented Aug 17, 2018

dose'nt it should stay there ?

@siempay siempay changed the title utf8 characteres not showing correctly UTF-8 characteres not showing correctly Aug 17, 2018
@serdarkok
Copy link

For Solutions:

/vendor/artesaos/seotools/SEOMeta.php Line: 254
$this->description = (false == $description) ? $description : strip_tags(htmlentities($description));
change this:
$this->description = (false == $description) ? $description : strip_tags(html_entity_decode($description));

/vendor/artesaos/seotools/OpenGraph.php Line: 834

return $this->addProperty('description', htmlentities($description));

change this:
return $this->addProperty('description', html_entity_decode($description));

/vendor/artesaos/seotools/TwitterCards.php Line: 136

return $this->addValue('description', htmlentities($description));

change this:

return $this->addValue('description', html_entity_decode($description));

@StApostol
Copy link
Contributor

@reasecret, the problem looks like it is coming from this {!! SEO::generate() !!}.
this displays HTML Code in blade but it parse the non-UTF8 characters
So a better way is to change this {!! SEO::generate() !!} to {!!html_entity_decode(SEO::generate())!!}

I did as you suggested just added a flag ENT_NOQUOTES

@klimov-paul
Copy link
Contributor

PR: #159

This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants