Topic-icon wrong share to facebook

Active Subscriptions:

None
10 years 10 months ago - 10 years 10 months ago #33609 by dimtsa
Hi,

When i try to post my k2 item to facebook i get characters that cannot understand.This happens after enabling successfully k2 opengraph and jfbc system plugins in order to solve the issue with the wrong images posted.It seems that russian characters can not be passed correctly
File Attachment:


Thanks in advance
Last edit: 10 years 10 months ago by dimtsa.
The topic has been locked.
Support Specialist
10 years 10 months ago #33619 by alzander
Replied by alzander on topic wrong share to facebook
When I look at the HTML on that article, the initial text looks like:
В своём труде  "О хранении чувств " Св.Никодим Святогорец  даёт нам советы, как властвовать над
The Open Graph description looks like:
В своём труде� 'О хранении чувств ' Св.Никодим Святогорец� даёт...
Obviously, the og:description is wrong. It seems like the   codes in the text are what are causing the problem. Are you inserting those into the article text? If so, can you try removing them and see if that fixing the og:description tag?

We can look into why the   is causing issues as well, but removing them may be the quickest solution, if possible.

Once you make any changes, run the page through the URL Debug Tool to test again what Facebook sees. Hitting "Like" or "Send" again won't necessary reflect the changes immediately.

Hope that helps,
Alex
The topic has been locked.
Active Subscriptions:

None
10 years 10 months ago #33627 by dimtsa
Replied by dimtsa on topic wrong share to facebook
In a similar problem in the past, you advised me to do the following:

"
Very sorry for the delay in getting back to this. We've done a lot of research, and have a minor code change we'd like you to try and implement to see if it fixes the problem you're having. Basically, we do a lot of manipulation to the text of the article to try and make sure only real text is used for the description, and it looks like one of our changes are changing 'good' characters to bad ones.

To fix, please edit the /libraries/sourcecoast/utilities.php file. Around line 391, you'll see the following block of code:
Code:
// turn some HTML with non-breaking spaces into a "normal" string
$converted = strtr($htmlText, array_flip(get_html_translation_table(HTML_ENTITIES, ENT_QUOTES)));
$converted = trim($converted," \t\n\r\0\x0B".chr(0xC2).chr(0xA0)); // UTF encodes it as chr(0xC2).chr(0xA0)
Please edit that by removing those first 2 lines and replacing it as below:
Code:
// turn some HTML with non-breaking spaces into a "normal" string
$converted = htmlspecialchars(strip_tags($htmlText), ENT_QUOTES, 'UTF-8');
return $converted;
Please let us know how that goes, but hopefully it will fix you right up. Just so you know, I deleted the other duplicate post you made about this. It's easier to just continue this discussion.

Thanks, and good luck,
Alex
"
The topic has been locked.