I'm a bit baffled how to fix this problem. Am learning PHP as I go, so bear please bear with me.
I have a postgres database, charset SQL_ASCII
I have a table that stores publications, in which contains accented characters.
The database itself is storing names as Brückner, Giménez, etc.
Using the data stored in this table, I am trying to generate an RSS feed.
Have been successful with this, bar one problem, which I think is down to the incompatible charset of the database with that of the XML for the feed won't convert SQL_ASCII and will only take UTF-8. Is that right?
If so, anyone know a workaround?
Not sure if this has any relevance, but I have looked at PHP info and default_charset is set to "no value" (out of my control)
Apache/1.3.33 (Unix) mod_ssl/2.8.22
OpenSSL/0.9.7g
PHP/4.3.11
Example of my feed so far (note the accented character problem can be seen on list item 4)
http://www.iser.essex.ac.uk/misoc/rss/misoc-publications.php
My page code is below:
<script language="php">
header("Content-type: text/xml");
echo "<?xml version=\"1.0\" ?>" ;
echo "<?xml-stylesheet type=\"text/css\" href=\"/misoc/css/rss.css\" ?>" ;
</script>
<rss version="2.0" xmlns:media="http://search.yahoo.com/mrss/" xmlns:dc="http://purl.org/dc/elements/1.1/">
<script language="php">
//
// Include our classes.
include_once("adminbase/database/AdminBaseConnectionFactory.inc") ;
include_once("adminbase/research/Programme.inc") ;
include_once("adminbase/research/ProgrammePublicationList.inc") ;
//
// Create new IserAdminBaseConnection object.
$adminbase =& AdminBaseConnectionFactory::instance() ;
$adminbase->open();
//
// Create a new programme object.
$programme = new Programme(1) ;
//
// Check we have an AdminBase database connection.
if($adminbase->isOpen())
{
// Get the list of recent publications.
$list =& $programme->getRecentPublications(10) ;
//
// Begin our RSS Feed.
echo "<channel>\n\t\t" ;
echo "<title>MISOC Publications</title>\n\t\t" ;
echo "<description>The central focus of our research is the life-course of the individual and the changing nature of society. Main areas of research include the family; labour markets; income and poverty; social disadvantage; and public policy.</description>\n\t\t" ;
echo "<lastBuildDate>Thu, 26 Apr 2007 15:12:00 GMT</lastBuildDate>" ;
echo "<link>http://www.iser.essex.ac.uk/misoc/</link>\n\t\t" ;
echo "<ttl>60</ttl>\n\t\t" ;
echo "<language>en-gb</language>\n\t\t" ;
echo "<generator>php v4.3.11</generator>\n\t\t" ;
echo "<webMaster>jenifer@essex.ac.uk (Jenifer Tucker)</webMaster>" ;
//
// Add our sub-elements.
//
// For each of the publications in the list.
while ($list->hasNext())
{
//
// Get the next publication and wrap it in a citation.
$publication = $list->getNext() ;
$citation = $publication->getCitation() ;
//
// Don't show 'Also published as' list for this publication.
$citation->setAlsoPublished(false) ;
$citation->rss() ;
}
//
// End our RSS feed.
echo "\n</channel>\n";
}
else {
// echo "Oops, the database is currently off-line. Apologies for any inconvenience." ;
}
</script>
</rss>
Any help would be appreciated .. have spent weeks looking at this :-/
Jenifer