Note that there are some explanatory texts on larger screens.

plurals
  1. POWith Classic ASP randomly ADODB.Recordset are "double encoded"
    text
    copied!<p>I've a problem and I can't understand what is causing it. I'm working on a legacy website, written in Classic ASP (<em>oh god why me</em>), and sometimes at apparently random time without any explanation the values from ADODB.Recordset are printed double encoded.</p> <p>With <em>double encoded</em> I mean the "<em>UTF-8 encoding of the ASCII representation of an UTF-8 multibyte string</em>" so the "<strong>é</strong>" would look like "<strong>é</strong>" (with the exact same encoding).</p> <p><strong>The thing that is driving me crazy is that this appears to happen at random time, the 50% of the times they are encoded correctly, the other 50% they aren't.</strong></p> <p>Let me point out that it happens on the same page at different times, so after several page loads you could display them correctly, then broken, then again correctly and so on.</p> <p>This thing happened 7 years ago in the early days of this website but a lot of water has passed under the bridge and only one of the guys that worked on this website in the first place still works in the company. He can't remember what did they do to solve the issue, he left me saying only that "the database connection encodings were saved into the session", and that perhaps can explain why there are so many <code>Session.CodePage = 65001</code> around the page.</p> <p>I even tried to force the charset to <code>utf8</code> via query but clearly it didn't work.</p> <p>The driver used is the olde <code>MySQL ODBC 3.51 Driver</code>.</p> <p>Thanks in advance for any advice or solution (get rid of Classic ASP unfortunately is not an option).</p> <p>[UPDATE]</p> <p>Here it is a plot twist, it breaks less times if I output the contents like this:</p> <pre><code>Session.CodePage = 1252 Response.Write(Property) Session.CodePage = 65001 </code></pre> <p>Actually I found this code almost everywhere in the website, as if the database driver didn't care at all about the connection's charset.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload