Simple Machines Community Forum

Customizing SMF => SMF Coding Discussion => Aiheen aloitti: Biology Forums - heinäkuu 07, 2014, 07:51:58 IP

Otsikko: Post feeder help
Kirjoitti: Biology Forums - heinäkuu 07, 2014, 07:51:58 IP
My feed poster software cannot distinguish certain html characters like those highlighted in attachment one. So, when it posts the feed, those characters become question marks. I have also attached the code responsible for posting the feed:

$msg_body = '';

if ($feed['html'])
{
//echo "body: " . $context['feeditems'][$i]['description'];
$msg_body =  ($context['feeditems'][$i]['description']);
$msg_body = $func['htmltrim']($msg_body);
preparsecode($msg_body);
$msg_body = '[html]'' . $msg_body . '[/html]';

$msg_body  .=  $func['htmlspecialchars']();

if (!empty($feed['footer']))
$msg_body .=  $func['htmlspecialchars']("\n\n" . $feed['footer'], ENT_QUOTES);


}


I was hoping someone could tell me how I could fix this code so that those characters show properly. It is not a database language issue because when I manually use [html] with the exact same html as shown in the picture, those characters are presented properly, so it has to be the code that is preparing the feed.
Otsikko: Re: Post feeder help
Kirjoitti: Arantor - heinäkuu 07, 2014, 08:08:58 IP
So, what's the feed, and is your forum UTF-8 or not? (It clearly is an encoding issue even if you're convinced it's not.)

Also, why isn't this in the thread for the mod in question?
Otsikko: Re: Post feeder help
Kirjoitti: Biology Forums - heinäkuu 07, 2014, 08:16:55 IP
Because I've tried the mod author, and his response is - I'm busy. My community can't run on anyone's watch.

My forum is configured with UTF-8. Like I said, I tried the exact same html when I manually posted the thread and all characters showed correctly. Thus, I'm convinced it's the way the mod if written.
Otsikko: Re: Post feeder help
Kirjoitti: Arantor - heinäkuu 07, 2014, 08:24:14 IP
Your theory about it being the mod is correct but for totally the wrong reason.

When you copy/paste it manually, your browser is transliterating it into UTF-8 FOR YOU so it's correct. Even though as ever you refuse to provide enough information, it's a fairly good guess from what you have told me that the feed is Win-1252.
Otsikko: Re: Post feeder help
Kirjoitti: Biology Forums - heinäkuu 08, 2014, 09:04:29 AP
Anyone else shed some light on how I could alter the code so I don't run into this trouble again?
Otsikko: Re: Post feeder help
Kirjoitti: Arantor - heinäkuu 08, 2014, 02:50:48 IP
How about you start by listing the feed URL so that we can actually verify rather than guess?

Oh wait, that would be in the definition of not being nice. Eh.
Otsikko: Re: Post feeder help
Kirjoitti: Biology Forums - heinäkuu 08, 2014, 03:40:18 IP
http://fulltextrssfeed.com/www.biosciencetechnology.com/rss-feeds/all/rss.xml/all
Otsikko: Re: Post feeder help
Kirjoitti: Biology Forums - heinäkuu 11, 2014, 12:42:03 AP
Any coders out there willing to toss me a bone here? :-/