On Mon, 2010-03-29 at 14:25 +0530, Nilesh Govindarajan wrote: > On 03/29/2010 01:22 PM, Ashley Sheridan wrote: > > On Mon, 2010-03-29 at 07:24 +0530, Nilesh Govindarajan wrote: > >> On 03/29/2010 07:22 AM, solo hsi wrote: > >> > i think you just need function urldecode().... > >> > > >> > On Mon, Mar 29, 2010 at 8:05 AM, Skip Evans<skip@xxxxxxxxxxxxxxxxx <mailto:skip@xxxxxxxxxxxxxxxxx>> wrote: > >> >> Hey all, > >> >> > >> >> What's the best way to filter/convert characters that don't > >> >> translate properly from say news stories to HTML? > >> >> > >> >> For example, I have a form that people cut and paste the lead > >> >> in paragraph from news stories they want to link to from their > >> >> sites to the original. And of course things like long dashes, > >> >> double quotes, single quotes, etc, always translate is wacky > >> >> unprintables when they are rendered, and the user needs to > >> >> edit them to replace them with standard characters. > >> >> > >> >> Is there way to filter this text through a function that will > >> >> convert them to web friendly chars? > >> >> > >> >> Thanks, > >> >> Skip > >> >> > >> >> -- > >> >> ==================================== > >> >> Skip Evans > >> >> PenguinSites.com, LLC > >> >> 503 S Baldwin St, #1 > >> >> Madison WI 53703 > >> >> 608.250.2720 > >> >> http://penguinsites.com > >> >> ------------------------------------ > >> >> Those of you who believe in > >> >> telekinesis, raise my hand. > >> >> -- Kurt Vonnegut > >> >> > >> >> -- > >> >> PHP General Mailing List (http://www.php.net/) > >> >> To unsubscribe, visit:http://www.php.net/unsub.php > >> >> > >> >> > >> > > >> > > >> > > >> > >> No, only urlencode() won't do the job. He's saying more about the long > >> spaces and quotes, etc. > >> > >> -- > >> Nilesh Govindarajan > >> Site& Server Administrator > >> www.itech7.com <http://www.itech7.com> > >> मेरा भारत महान ! > >> मम भारत:महत्तम भवतु ! > >> > > > > I wrote something that converts these characters, which you'll most > > often find when copying text from MS Office: > > > > http://www.ashleysheridan.co.uk/coding_php_remove_ms_crap.php > > > > The second argument to the function just tells it to remove all the > > hidden meta tags that MS Office chucks into text that you copy into a > > rich text box in a web page, as this can really mess up how the content > > is displayed in a web browser. > > > > Thanks, > > Ash > > http://www.ashleysheridan.co.uk > > > > > > Nice one. But not of use to me. I use geshi on my site, so cannot use > WYSIWYG editors. Instead I've BBCode and WikiCreole (PEAR Wiki) input > formats. > > -- > Nilesh Govindarajan > Site & Server Administrator > www.itech7.com > मेरा भारत महान ! > मम भारत: महत्तम भवतु ! > It's not just for wysiwyg editors, that's just the second part of the function. The first does just what you asked for. Thanks, Ash http://www.ashleysheridan.co.uk