title: Where to trim/encode/fix characters from end to end ASP to SQL?
body: <p>I have an ASP Classic app that allows people to copy and paste Word documents into a regular form field. I then post that document via jQuery Ajax to SQL Server, where the information is saved.</p>
  
  <p>My problem is that the curly quotes and other word characters turn into strange characters when they come back out.</p>
  
  <p>I'm trying to filter them on my save routines (classic asp stored procedure), but I still can't quite eliminate the problems.</p>
  
  <p>The ASP pages have this header with the ISO-8859-1 charset. Characters look fine when pasted into the text input fields.</p>
  
  <pre class="lang-html prettyprint-override"><code>&lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
            "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"&gt;
  &lt;html xml:lang="en" xmlns="http://www.w3.org/1999/xhtml" lang="en"&gt;
      &lt;head&gt;
      &lt;meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"&gt;
  </code></pre>
  
  <p>My jQuery code builds the following JSON in the ASP Page:</p>
  
  <pre class="lang-js prettyprint-override"><code>var jsonToSend = { serial: serial, critiqueText: escape(critiqueText) };
  </code></pre>
  
  <p>The database collation is set to <strong>SQL_Latin1_General_CP1_CI_AS</strong></p>
  
  <p>I use TEXT and <code>VARCHAR</code> fields to hold the text (yes, I know the Text field type is not preferred, but it's what I have right now).</p>
  
  <p>What must I do at each point to ensure that (1) the Word characters are stripped out, and (2) the encoding is consistent from front to back so I don't get any odd characters displaying?</p>
  
  <p>Oh-  ASP Classic 3 running in 32-bit mode on Windows Server 2003 against SQL Server 2005.</p>