Accents missing
-
## EDIT:
—
I set up API, RSS and started to update permalinks. But I got a problem with accents. They are missing. When I check my blog is everything ok. But on Facebook’s Instant Dashboard, they are mistyped.
All my articles are written in PT-BR.
Someone could point me a solution, please?
-
After doing some research, I think the problem could be related to <meta charset> but I’m not sure of this
I know Instant Articles are set to use utf-8 by default. When I tried to change it on Facebook Dashboard to ISO-8859-1, it gives me an error related to charset.
What I can’t understand is why my blog already uses utf-8 and accents are fine, but on dashboard they got broken.
Hi, thikoneres2016. Thanks for the feedback.
Could you provide some more information about the issue you’re having? That will help us reproduce the issue.
– What version of the plugin are you using?
– What version of WordPress are you using?
– What version of PHP are you using?
– What’s the debug output shown in the post edit screen on the Facebook Instant Article box (both sides)?
– What is the charset of your database for WordPress? The collation used.I did some research about your published articles.
This is the one Im looking right now:
http://bit.blog.br/transmissoes-de-eventos-esportivos-em-redes-sociais-4423Looks like the title is escaped correctly:
<h1>Transmissões de eventos esportivos em redes sociais</h1>But the body of article, seems to be in another charset:
<p>Esporte é algo que acontece ao vivo e sem roteiro. Eles mexem com nossa razão e emoção – especialmente em um paÃs com grande tradição esportiva, como o Brasil – de modo que é natural o impulso de querermos registrar nossas opiniões sobre eles nas redes sociais.</p>Thanks again!
Here are the prints about the encoding issue: http://postimg.org/gallery/2j31q28fq/
My regular RSS Feed: http://bit.blog.br/feed
Plugin RSS Feed: http://bit.blog.br/feed/instant-articles
Original post: http://bit.blog.br/landing-jobs-evento-ti-europa-brasileiros-4411
* I noticed that titles are fine, even if they have special characters like accents. The problem is post content.
PHP version 5.5.30
MySQL version 5.5.48.
Plugin version 2.7Same problem, can’t understand why this occurs only with this plugin and not on the rest of website…
More technical information :
plugin version 2.8
PHP 7.0
mysql 5.6.28stranger is that with latest release of MAMP for Mac, in localhost, I don’t have the accents problem…
This was fixed in this ticket https://github.com/Automattic/facebook-instant-articles-wp/issues/116
Here is the commit in the file “fb-instant-articles/class-instant-articles-post.php” line 666 just and else to fix encoding
else { $content = htmlspecialchars_decode( utf8_decode( htmlentities( $content, ENT_COMPAT, 'utf-8', false ) ) ); }I was having the same problem and this fix it, hope they add it in the next update of this plugin.
Thanks to the developers and the guy how fix it!
@modee, thanks for reporting this fixed.
@thikoneres2016, @unsacsurledos, it’d be great to get confirmation that by installing the latest version of the plugin (v2.9), the problem goes away.
For now, I’m marking this issue as resolved since a fix is available for download. Please re-open if the problem persists.
Hello,
I’m using version 3.1.3 and getting incorrect accent chars inside H1 element (that is created automatically inside header). This is the only problem. The rest (title and text) are correct.
Does anyone knows what should I do to fix this?
Thanks in advanced.
I’ve found the problem:
At the file
class-instant-articles-post.php
line 638
I’ve added utf8_decode to $title variable:$document->loadHTML( '<?xml encoding="' . $blog_charset . '" ?><h1>' . utf8_decode($title) . '</h1>' );And now it’s working corrrectly.
I don’t know if this is the best approach, but it worked for me.
(version 3.1.3)@programadorgw, the following update was made in the latest version of the plugin (v3.2). Can you see if this also resolves your issue in a native way?
@demoive, the problem was not solved. In this version (3.2) I had to put again the utf8_decode command.
Line 639 for me at this moment:
$document->loadHTML( '<?xml encoding="' . $blog_charset . '" ?><h1>' . utf8_decode($title) . '</h1>' );-
This reply was modified 9 years, 5 months ago by
programadorgw.
-
This reply was modified 9 years, 5 months ago by
The topic ‘Accents missing’ is closed to new replies.