How to get rid of those funky question marks in your content…
Question posed recently on the Warriors Internet Marketing forum:
“I have a css/html template and when i add an article text and then view the page it displays all of the apostrophes and quotes as question marks. how do i fix this?”
Here’s the thing… That happens a lot when the original text came from something like an MS Word document. The problem could be unicode characters. What you *think* looks like an apostrophe or quote mark, really isn’t.
Simple fix if the problem is on a php page:
<?php
function callback($buffer) {
$unicode_array = array(
"–" => "-",
"—" => "-",
"–" => "-",
"‘" => "'",
"’" => "'",
"’" => "'",
"‘" => "'",
"…" => "...",
"…" => "...",
"“" => "\"",
"“" => "\"",
"”" => "\"",
"”" => "\""
);
$rbuffer = strtr($buffer, $unicode_array);
$retstr = '';
for($i=0; $i < strlen($rbuffer); $i++){
if(ord($rbuffer[$i]) >= 126) $retstr .= '&#' . ord($rbuffer[$i]) . ';';
else $retstr .= $rbuffer[$i];
}
return $retstr;
}
ob_start("callback");
?>
Paste the above code to the top of your content page… it can be before the opening html tag, or before your main content. What the function does is process all remaining browser output through the callback buffer function, cleans all the pesky unicode characters it finds, then displays the cleaned up content. Viola! No more pesky question mark characters displaying
Hope this helps you out!



























