Forum Moderators: coopster

Message Too Old, No Replies

Latin1 to UTF8 question

My RSS output replaces some elements.

         

asantos

11:22 pm on May 29, 2006 (gmt 0)

10+ Year Member



Hi.
My CMS' mysql db collation is in latin1. I have a news module, that has an optional RSS2.0 file. Partial example of rss.php:


header('Content-type: application/xml; charset="UTF-8"',true);
echo '<?xml version="1.0" encoding="UTF-8"?>';
echo "\n";
echo '<rss version="2.0">';
echo "\n";
echo '<channel>';
echo "\n";
echo '<title>'.get_option('title').'</title>';
echo "\n";
echo '<link>'.URL.'</link>';
echo "\n";
echo '<description>'.get_option('description').'</description>';
...

The problem is that some data in "description" contains some of this characters: αινσϊ, and they all get converted to a '?'.

How can I avoid this problem and still show the appropiate character in the rss output? Is there a way to convert the get_option('description') to utf8 data?

Thanks,
Andres

asantos

2:10 am on May 30, 2006 (gmt 0)

10+ Year Member



nevermind, i found the utf8_encode() php function.