for file maker pro (windows/mac) -- word (windows/mac) function make_safe($text) { $text = preg_replace("/(\cM)/", " ", $text); $text = preg_replace("/(\c])/", " ", $text); $text = str_replace("\r\n", " ", $text); $text = str_replace("\x0B", " ", $text); $text = str_replace('"', " ", $text); $text = explode("\n", $text); $text = implode(" ", $text); $text = addslashes(trim($text)); return($text); }
function make_safe2($text) { $text = str_replace("\r\n", "\n", $text); $text = preg_replace("/(\cM)/", "\n", $text); $text = preg_replace("/(\c])/", "\n", $text); $text = str_replace("\x0B", "\n", $text); $text = addslashes($text); return($text); } cannot remember I why put in two functions ... but anyhow have fun you will probably not the the implode / explode either On Tue, 2002-10-29 at 16:39, Daniel Guerrier wrote: > Paste into notepad, the copy the text from notepad. > Notepad should remove the high ASCII text. > --- Brent Baisley <[EMAIL PROTECTED]> wrote: > > I think you have posted before and probably didn't > > get an answer. I'm > > not going to give you an answer (because I don't > > have one), but perhaps > > I can point you in the right direction. > > Look at http://www.w3.org/TR/REC-html40/charset.html > > and see if that > > helps you. Below is a paragraph I pulled from it. > > > > The document character set, however, does not > > suffice to allow user > > agents to correctly interpret HTML documents as they > > are typically > > exchanged -- encoded as a sequence of bytes in a > > file or during a > > network transmission. User agents must also know the > > specific character > > encoding that was used to transform the document > > character stream into a > > byte stream. > > > > > > On Tuesday, October 29, 2002, at 02:20 PM, a.h.s. > > boy wrote: > > > > > I'm working on a PHP-based CMS that allows users > > to post lengthy > > > article texts by submitting through a form. The > > short version of my > > > quandary is this: How can I create a conversion > > routine that reliably > > > substitutes HTML-acceptable output for high-ASCII > > characters pasted > > > into the form (from a variety of operating > > systems)? > > > > > -- > > Brent Baisley > > Systems Architect > > Landover Associates, Inc. > > Search & Advisory Services for Advanced Technology > > Environments > > p: 212.759.6400/800.759.0577 > > > > > > -- > > PHP General Mailing List (http://www.php.net/) > > To unsubscribe, visit: http://www.php.net/unsub.php > > > > > __________________________________________________ > Do you Yahoo!? > HotJobs - Search new jobs daily now > http://hotjobs.yahoo.com/ > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php