Page 2 of 2
Posted: Sat Jan 12, 2008 5:27 pm
by pmjdebruijn
In import.inc.php
function &decode($string) {
$target = $this->data['charset'];
$out = iconv('ISO-8859-1', 'UTF-8', $string);
$good = iconv('UTF-8', 'UTF-8//IGNORE', $out);
return $good;
}
Even this doesn't seem to help.
I'm not familiar enough with the Serendipity codebase to find out what is going wrong. But somehow some invalid characters are still reaching PostgreSQL.
Posted: Sat Jan 12, 2008 8:30 pm
by garvinhicking
Hi!
Hm, when using MySQL, this works for me...so I do believe there must be a postgresql client or server library issue...
Regards,
Garvin
Posted: Sun Jan 13, 2008 12:40 pm
by pmjdebruijn
No.
PostgreSQL just stricktly adheres to UTF8. As it should!
Somehow, invalid characters are arriving at the PostgreSQL database.
Most likely the invalid characters are in my original MySQL database, and s9y is failing to take them out before storing the data in my PostgreSQL database.
Posted: Sat Feb 02, 2008 1:15 pm
by pmjdebruijn
I noticed the decode function isn't used by the wordpress.inc.php file.
Where should I call it, to cleanup the contents of some posts.
Posted: Sat Feb 02, 2008 1:33 pm
by garvinhicking
Hi!
Actually, it is used. Check for $this->decode(), it is applied to the title there for example.
Also, the $this->strtr() function decodes all strings, this is declared in the global Importer class in include/admin/importers.inc.php.
I wish I could be more of help, but I don't really know how pgsql operates in these cases and where to check for errors/problems with char coding. MySQL does all that for me
Regards,
Garvin