Pesky Curly Quotes

October 17, 2005

Numerous problems with strange characters in feeds are due to character encoding issues, especially content derived from sources that publish those pesky curly quotes. If your content is displaying unexpected characters, then there are two things to adjust- first is to select the UTF-8 encoding when building your feeds, but also your content page must either serve all content as UTF-8 or have in its HEAD content:
<meta http-equiv="content-type" content="text/html; charset=utf-8">
Unfortunately, I discovered that our preview.php script used on this site and distributed was not properly testing for proper encoding, so sites using Feed2JS can either download the most recent version or siply make this update to preview.php.

FIND:
<meta http-equiv="content-type" content="text/html; charset=iso-8859-1">
REPLACE with:
<?php 
	if ($utf== 'y') {
		echo '<meta http-equiv="content-type" content="text/html; charset=utf-8">';
	} else {
		echo '<meta http-equiv="content-type" content="text/html; charset=iso-8859-1">';
	}
?>

Write a comment










Remember personal info?





Spam Prevention Security Code: Enter the numbers you see in the image above