On Tue, 2009-05-05 at 16:22 -0700, Michael A. Peters wrote:
> Ashley Sheridan wrote:
> 
> >>
> > content coming from MS Office clipboard pastes generally contain
> > characters that are encoded wrong, and do not display correctly in web
> > pages unless they have very relaxed doctypes. The function I generally
> > use is:
> > 
> > function removeMSCrap($crap)
> > {
> >     $find = Array(chr(128), chr(133), chr(8226), chr(145), chr(8217),
> > chr(146), chr(8220), chr(147), chr(8221), chr(148), chr(8226), chr(149),
> > chr(8211), chr(150), chr(8212), chr(151), chr(8282), chr(153), chr(169),
> > chr(174));
> >     $replace = Array("€", "…", "″", "'", "'",
> > "'", "'", """, """, """, """, "•",
> > "•", "–", "–", "—", "—", "™", "™",
> > "©", "®");
> >     
> >     $roses = str_replace($find, $replace, $crap);
> >     return $roses;
> > }
> 
> Is that something you would suggest be used in any web app that has a 
> textarea for input?
> 
It is valid for that also. I've used it on standard <input type="text"/>
tags before as well.


Ash
www.ashleysheridan.co.uk


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to