scrap pad

somewhat quick and dirty

fix to get special characters into twitter. php's html_entity_decode() doesn't handle numeric entites (in php 4.4, at least), but you can do what you need with regexes (as in this comment). except then, cell phones probably don't have right and left quotes, m dashes, etc., so everything should be extra-plain text anyway. a small translation array, for use with php's strtr():

$entities2plain = array( 
     """ => '"',
     """ => '"',
     """ => '"',
     "&" => "&",
     "&" => "&",
     "&" => "&",
     "'" => "'",
     "'" => "'",
     "'" => "'",
     "–" => "-",
     "–" => "-",
     "—" => "--",
     "—" => "--",
     "‘" => "'",
     "‘" => "'",
     "’" => "'",
     "’" => "'",
     "“" => '"',
     "“" => '"',
     "”" => '"',
     "”" => '"',
     "…" => "...",
     "…" => "...",     
);

Archives

who I am