[geeklog-devel] Feed handling of Danish

Michael Jervis mjervis at gmail.com
Mon Apr 28 14:45:17 EDT 2008


Checking back in on this:

I'm confused!

In 1.611 of lib-common.php you committed support for UTF-8 feeds.
COM_rdfimport checks the charset of a Geeklog instance:

        $charset = COM_getCharset();

        // format articles for display
        $readmax = min($maxheadlines, count($feed->articles));
        for ($i = 0; $i < $readmax; $i++) {
            if (empty($feed->articles[$i]['title'])) {
                $feed->articles[$i]['title'] = $LANG21[61];

            if ($charset == 'utf-8') {
                $title = $feed->articles[$i]['title'];
            } else {
                $title = utf8_decode($feed->articles[$i]['title']);

So, we get the charset of a Geeklog instance,and if it's UTF-8 we do
nothing to the title, if it's not, we utf8_decode the title.

The feed in question is iso-8859-1 and my Geeklog instance is
iso-8859-1. So in this case we're UTF8 decoding something that isn't
UTF-8 and loosing the special characters.

I believe the correct option is to utf8_decode if and only if the feed
is UTF-8 and the site is not. But I'm confused due to the deliberate
implementation of this logic.


Michael Jervis
mjervis at gmail.com

More information about the geeklog-devel mailing list