views:

321

answers:

1

I have a very tricky problem going on with content inside a textarea on a classic ASP page.

The trigger for the issue is that the end user copies and pastes content from Word into a textarea on the page. This page then sends the contents of the form via email to a 3rd party contact management system. This system display the following characters when quotes are used:

Example Text: "This is a test" 'this is a test' Results: “This is a test” ‘this is a test'

I cannot do the following: - Prevent the user from Copy/Pasting - Change the page encoding - change any of the Contact Management System code - Pass back to the page using GET, POST fine. - Convert the page to .NET

I have tried numerous VBSCRIPT & Javascript fixes, but cannot seem to come to a solution. I'm very frustrated and could really use some help. I've obviously tried removing the quotes entirely (they are NOT required) but I can't seem to capture them. My guess is that this is some type of UTF8 or ANSI encoding issue, and have tried many scripts to convert back and forth, but so far nothing. I've tried numerous regular expression with absolutely no luck. I tried to replacing the text field with FCKEditor since I knew it could capture paste from word markup and remove it, but that solution only works for clients using IE, and I didn't get it even to work then. Just what in the hell am I missing here? Why I appreciate hints, I really need a good solution from someone.

+3  A: 

Ah, yes, Word and it's lovely "smart quotes" feature.

Have you tried this?

http://jonathanhedley.com/articles/2008/03/convert-microsoft-word-to-plain-text

pjabbott
Deleted my answer and up-voted this one. Mine didn't address the issue with Word.
CAbbott
Ha, the ONE freaking page I haven't come across yet. Well, the good new is that is did detect the smart quotes from word, but as in the example above, it had the effect of actually stripping our the entire "this is a test". But, I'm one step farther because this is the first time it's actually detected the smart quote markup.I'll fiddle with this for a bit.Thanks, man!
FluidFoundation