Smart Quotes not so smart
| From: | Larry Garfield | Date: | Thu, 16 Nov 2006 02:36:32 +0000 |
| Subject: | Smart Quotes not so smart | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-244705@lists.php.net to get a copy of this message | ||
I've run into this sort of issue a few times before, and never found a good
solution. Now a client has been hit with it and is asking for a solution,
and I'm not convinced there is one. :-)
Client has a large MS SQL database with lots of data. Some of that data
includes "smart quotes", aka curly quotes, but not real ones. They're the MS
Word character encoding standards? What's that?" smart quotes. On their old
setup (SQL Server 2k, OpenLink ODBC driver, IIS, PHP 4.0.6), they actually
worked just fine. On our old devel setup (the same but with a different ODBC
driver), it worked fine.
On our new devel setup (SQL Server 2k, OpenTDS ODBC driver, Apache, PHP
5.1.6), it works fine. On their new live setup, however, (same, but again
not sure of the ODBC driver) they're getting the dreaded squares or question
marks or accented characters that signify a garbled smart quote. I know
they're not unicode characters because Windows, the DB server, and the driver
are all set to either UTF-8 or UTF-16.
We've tried eliminating middle-men to no avail. I've also tried doing a
find-replace on the smart quote characters before they're inserted into the
database, copying and pasting them from Word, and PHP skips right past them
and enters them into the database.
All we're left with is MAYBE telling them to dry a different ODBC driver or
else fixing the data by hand. I don't like either option, myself. Does
anyone have any better ideas to suggest? Any idea what those smart quotes
actually are, and if they exist in ANY valid character set other than Word
itself?
--
Larry Garfield AIM: LOLG42
larry@garfieldtech.com ICQ: 6817012
"If nature has made any one thing less susceptible than all others of
exclusive property, it is the action of the thinking power called an idea,
which an individual may exclusively possess as long as he keeps it to
himself; but the moment it is divulged, it forces itself into the possession
of every one, and the receiver cannot dispossess himself of it." -- Thomas
Jefferson