Hi, so here's a code where I want it to output ƏIŞĞÖÜÇəışğöüç characters. Even I value utf8_encoding true, it does not output them. Any help?
<?php
define('MAGPIE_CACHE_ON', 1); //2.7 Cache Bug
define('MAGPIE_CACHE_AGE', 180);
define('MAGPIE_INPUT_ENCODING', 'UTF-8');
define('MAGPIE_OUTPUT_ENCODING', 'UTF-8');
$twitter_options['widget_fields']['title'] = array('label'=>'Title:', 'type'=>'text', 'default'=>'');
$twitter_options['widget_fields']['username'] = array('label'=>'Username:', 'type'=>'text', 'default'=>'');
$twitter_options['widget_fields']['num'] = array('label'=>'Number of links:', 'type'=>'text', 'default'=>'5');
$twitter_options['widget_fields']['update'] = array('label'=>'Show timestamps:', 'type'=>'checkbox', 'default'=>true);
$twitter_options['widget_fields']['linked'] = array('label'=>'Linked:', 'type'=>'text', 'default'=>'#');
$twitter_options['widget_fields']['hyperlinks'] = array('label'=>'Discover Hyperlinks:', 'type'=>'checkbox', 'default'=>true);
$twitter_options['widget_fields']['twitter_users'] = array('label'=>'Discover @replies:', 'type'=>'checkbox', 'default'=>true);
$twitter_options['widget_fields']['encode_utf8'] = array('label'=>'UTF8 Encode:', 'type'=>'checkbox', 'default'=>false);
$twitter_options['prefix'] = 'twitter';
// Display Twitter messages
function twitter_messages($username = '', $num = 1, $list = false, $update = true, $linked = '#', $hyperlinks = true, $twitter_users = true, $encode_utf8 = true) {
global $twitter_options;
include_once(ABSPATH . WPINC . '/rss.php');
$messages = fetch_rss('http://twitter.com/statuses/user_timeline/'.$username.'.rss');
if ($list) echo '<ul class="twitter">';
if ($username == '') {
if ($list) echo '<li>';
echo 'RSS not configured';
if ($list) echo '</li>';
} else {
if ( empty($messages->items) ) {
if ($list) echo '<li>';
echo 'No public Twitter messages.';
if ($list) echo '</li>';
} else {
$i = 0;
foreach ( $messages->items as $message ) {
$msg = " ".substr(strstr($message['description'],': '), 2, strlen($message['description']))." ";
if($encode_utf8) $msg = utf8_encode($msg);
$link = $message['link'];
if ($list) echo '<li class="twitter-item">'; elseif ($num != 1) echo '<p class="twitter-message">';
if ($hyperlinks) { $msg = hyperlinks($msg); }
if ($twitter_users) { $msg = twitter_users($msg); }
if ($linked != '' || $linked != false) {
if($linked == 'all') {
$msg = '<a href="'.$link.'" class="twitter-link">'.$msg.'</a>'; // Puts a link to the status of each tweet
} else {
$msg = $msg . '<a href="'.$link.'" class="twitter-link">'.$linked.'</a>'; // Puts a link to the status of each tweet
}
}
echo $msg;
?>