Re: Smart Quotes not so smart
| From: | Travis Doherty | Date: | Thu, 16 Nov 2006 05:35:37 +0000 |
| Subject: | Re: Smart Quotes not so smart | ||
| References: | 1 2 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-244707@lists.php.net to get a copy of this message | ||
Robert Cummings wrote:
>On Wed, 2006-11-15 at 20:36 -0600, Larry Garfield wrote:
>
>
>>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?
>>
>>
>
>There's a few different charsets that support them. Either way, can you
>open up some content that has them using a hex editor and tell us the
>hex codes for the bytes? That will help determine what charset.
>
>Cheers,
>Rob.
>
>
John Walker's insight might be a good lead on some more information on
exactly what these are, even if it doesn't directly solve the problem.
I can only guess that their 'smart quotes' exported to HTML from Office
apps are the same 'smart quotes' in your database... who knows :p
http://www.fourmilab.ch/webtools/demoroniser/
Travis Doherty