Skip to content

Commit

Permalink
fixed the unicode display issue finally--but i seem to have broken ca…
Browse files Browse the repository at this point in the history
…tefories and related links. oopsie
  • Loading branch information
gameguy43 committed Jun 13, 2010
1 parent fd1ef59 commit 254ab5f
Showing 1 changed file with 25 additions and 1 deletion.
26 changes: 25 additions & 1 deletion cleanr-deriv/page.php
Expand Up @@ -153,7 +153,31 @@ function gen_data_dir($id){
}


$data['desc'] = cleanup_html($data['desc']);
function unicode_fix($str){
$badwordchars=array(
'\xe2\x80\x98', // left single quote
'\xe2\x80\x99', // right single quote
'\xe2\x80\x9c', // left double quote
'\xe2\x80\x9d', // right double quote
'\xe2\x80\x94', // em dash
'\xe2\x80\xa6' // elipses
);
$fixedwordchars=array(
"‘",
"’",
'“',
'”',
'—',
'…'
);
// $str = iconv("Latin1", "UTF-8", $str);
// $str = strval($str);
// $str = utf8_decode($str);
$str = str_replace($badwordchars,$fixedwordchars,$str);
return $str;
}

$data['desc'] = unicode_fix(cleanup_html($data['desc']));
$data['links'] = parse_links($data['links']);
$data['categories'] = parse_categories($data['categories']);

Expand Down

0 comments on commit 254ab5f

Please sign in to comment.