Jump to content

Word special quote problem - dear God why can't this just work?!


br3nn4n

Recommended Posts

I'm copying some text from a Word doc (that's how the people I'm doing this for insist on doing things) and I'm running into the problems with the site ending up showing non-characters.

 

I'm running all my text through this before it's inserted into the database:

 

<?PHP
   $article = ereg_replace(38, "&", $article); // ampersand
   $article = ereg_replace(133, "&#133;", $article); // ellipses
   $article = ereg_replace(8226, "&#8243;", $article); // double prime
   $article = ereg_replace(8216, "&#039;", $article); // left single quote
   $article = ereg_replace(145, "&#039;", $article); // left single quote
   $article = ereg_replace(8217, "&#039;", $article); // right single quote
   $article = ereg_replace(146, "&#039;", $article); // right single quote
   $article = ereg_replace(8220, "&#034;", $article); // left double quote
   $article = ereg_replace(147, "&#034;", $article); // left double quote
   $article = ereg_replace(8221, "&#034;", $article); // right double quote
   $article = ereg_replace(148, "&#034;", $article); // right double quote
   $article = ereg_replace(8226, "&#149;", $article); // bullet
   $article = ereg_replace(149, "&#149;", $article); // bullet
   $article = ereg_replace(8211, "&#150;", $article); // en dash
   $article = ereg_replace(150, "&#150;", $article); // en dash
   $article = ereg_replace(8212, "&#151;", $article); // em dash
   $article = ereg_replace(151, "&#151;", $article); // em dash
   $article = ereg_replace(8482, "&#153;", $article); // trademark
   $article = ereg_replace(153, "&#153;", $article); // trademark
   $article = ereg_replace(169, "©", $article); // copyright mark
   $article = ereg_replace(174, "®", $article); // registration mark
?>

 

It seems to work, but honestly I don't know if it works on Macs (they use Macs) the same it does on Windows.

 

What I'm wondering now is this -- is it even necessary to convert the curly quotes? Or would they, since my site is UTF-8, show up normally without doing anything to them?

 

Can someone shed some light? Thanks

 

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.