title: Request.QueryString And Request.ServerVariables("QUERY_STRING") Not Displaying UNICODE
body: <p>I'm adding logging functionality to a Classic ASP application and am having difficulty getting Request.QueryString and Request.ServerVariables to display correctly when users submit UNICODE queries.</p>
  
  <p>For example - </p>
  
  <pre><code>Response.write Request.QueryString
  </code></pre>
  
  <pre>
  strVar1=&strVar2=%E8%A1%8C%E9%9B%B2%E6%B5%81%E6%B0%B4&strVar3=blah1&strVar4=blah2
  </pre>
  
  <p><br /></p>
  
  <pre><code>Response.write Request.ServerVariables("QUERY_STRING")
  </code></pre>
  
  <pre>
  strVar1=&strVar2=%E8%A1%8C%E9%9B%B2%E6%B5%81%E6%B0%B4&strVar3=blah1&strVar4=blah2
  </pre>
  
  <p><br /></p>
  
  <p>Yet if I specify a UNICODE variable in Request.QueryString it prints correctly:</p>
  
  <pre><code>Response.write Request.QueryString("strVar2")
  </code></pre>
  
  <pre>
  行雲流水
  </pre>
  
  <p><br /></p>
  
  <p>How can I get Request.QueryString or Request.ServerVariables("QUERY_STRING") to include UNICODE?  I do have the following on both my search and results pages and queries execute successfully against the database:</p>
  
  <pre><code>&lt;%
  Response.CodePage = 65001
  Response.CharSet = "utf-8"
  %&gt;
  </code></pre>
  
  <p>To answer bobince's question, I'm trying to log search terms and pages from which they're submitted - if there's a better way to do this I'm all ears:</p>
  
  <pre><code>'Enable Logging: writes to MyDB.dbo.logging
  '---------------------------------------------------------------------------------------------
  Set cmd = Server.CreateObject("ADODB.Command")
  cmd.CommandType = adCmdText
  cmd.ActiveConnection = objConn
  
  strADName = UCase(Request.ServerVariables("AUTH_USER"))
  
  Protocol = Request.ServerVariables("SERVER_PROTOCOL")
  Protocol = Left(Protocol,InStr(Request.ServerVariables("SERVER_PROTOCOL"),"/")-1)
  
  if Request.ServerVariables("SERVER_PORT") = "80" then
  port = ""
  else
  port = ":" &amp; Request.ServerVariables("SERVER_PORT")
  end if
  
  CurPageURL = lcase(Protocol) &amp; "://" &amp; Request.ServerVariables("SERVER_NAME") &amp;_
            port &amp; Request.ServerVariables("SCRIPT_NAME") &amp; "?" &amp; _
            Request.ServerVariables("QUERY_STRING")
  
  strSQL = "INSERT INTO MyDB.dbo.Logging([user],URL) SELECT ?, ? "
  cmd.Parameters.Append (cmd.CreateParameter("User", adVarWChar, adParamInput, len(strADName),    strADName))
  cmd.Parameters.Append (cmd.CreateParameter("URL", adVarWChar, adParamInput, len(CurPageURL), CurPageURL))
  
  cmd.CommandText = strSQL
  set objRS = cmd.Execute
  '-----------------------------------------------------------------------------------------------
  </code></pre>