[PHP] dealing with MSWord curly quotes in text

2002-02-20 Thread austin swinney


im having a problem with text being submitted to my site through forms
into the database, where the text has been edited in MSWord and the
quotes that it uses get turned into question marks.  does anyone know a
way to convert these MSWord quotes to normal  marks?


-- 
austin swinneyET-Arrr
[EMAIL PROTECTED]   pirates of programming

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




Re: [PHP] dealing with MSWord curly quotes in text

2002-02-20 Thread Analysis and Solutions

Hey Austin:

 text has been edited in MSWord and the
 quotes that it uses get turned into question marks.  does anyone know a
 way to convert these MSWord quotes to normal  marks?

Replace the nasties with preg...

   $Data = preg_replace('/[\x93\x94]/', '', $Data);


I figured out the Hex numbers of the offending characters by pasting such an
offensive character into the following piece of code where the x is...

   echo dechex(ord('x'));


You could use the same principles to replace all sorts of junk.

Enjoy,

--Dan

-- 
PHP scripts that make your job easier
  http://www.analysisandsolutions.com/code/
 SQL Solution  |  Layout Solution  |  Form Solution
 T H E   A N A L Y S I S   A N D   S O L U T I O N S   C O M P A N Y
 4015 7 Ave, Brooklyn NY 11232v: 718-854-0335f: 718-854-0409

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