Search This Blog

Sunday, December 06, 2009

Fixed my web site

After a few years of upgrades to the hosting of my web site (PHP 4.2->5.0->5.1->5.2) and expected changes on the world wide web my site became pretty broken. I can now proudly say I have fixed most of the bugs on this site. The biggest problem was updating how I was aggregating news feeds, I only had to update my code to support RSS 0.91/2.0, RSS 1.0, RDF, ATOM "channel", and ATOM "entry". Yay for standards.

Monday, June 29, 2009

I need to vent

Grr, f***, sh**, a** f***! I am setting up one of my PHP CMS's and was having trouble with non-ASCII characters. After pulling my hair out and endless googling I found the problem, htmlentities(). It turns out that htmlentities() is set to ISO-8859-1 by default and needs a specific parameter to be UTF-8.

I found this:

/**
 * Encodes HTML safely for UTF-8. Use instead of htmlentities.
 *
 * @param string $var
 * @return string
 */
function html_encode($var)
{
 return htmlentities($var, ENT_QUOTES, 'UTF-8') ;
}

Here:
http://developer.loftdigital.com/blog/php-utf-8-cheatsheet