mirror of
https://github.com/RSS-Bridge/rss-bridge.git
synced 2025-07-30 21:30:14 +02:00
[formats] Use custom characterset in all formats
The specified characterset will now apply to all formats thus allowing other charactersets than 'UTF-8'
This commit is contained in:
@@ -47,10 +47,11 @@ EOD;
|
||||
}
|
||||
|
||||
$feedTimestamp = date(DATE_ATOM, time());
|
||||
$charset = $this->getCharset();
|
||||
|
||||
/* Data are prepared, now let's begin the "MAGIE !!!" */
|
||||
$toReturn = '<?xml version="1.0" encoding="UTF-8"?>';
|
||||
$toReturn .= <<<EOD
|
||||
$toReturn = <<<EOD
|
||||
<?xml version="1.0" encoding="{$charset}"?>
|
||||
<feed xmlns="http://www.w3.org/2005/Atom" xmlns:thr="http://purl.org/syndication/thread/1.0">
|
||||
|
||||
<title type="text">{$title}</title>
|
||||
@@ -64,15 +65,15 @@ EOD;
|
||||
</feed>
|
||||
EOD;
|
||||
|
||||
// Remove invalid non-UTF8 characters
|
||||
// Remove invalid characters
|
||||
ini_set('mbstring.substitute_character', 'none');
|
||||
$toReturn = mb_convert_encoding($toReturn, 'UTF-8', 'UTF-8');
|
||||
$toReturn = mb_convert_encoding($toReturn, $this->getCharset(), 'UTF-8');
|
||||
return $toReturn;
|
||||
}
|
||||
|
||||
public function display(){
|
||||
$this
|
||||
->setContentType('application/atom+xml; charset=UTF-8')
|
||||
->setContentType('application/atom+xml; charset=' . $this->getCharset())
|
||||
->callContentType();
|
||||
|
||||
return parent::display();
|
||||
|
Reference in New Issue
Block a user