title: preserving case for coldfusion structs when converted to JSON
body: <p>Using the array notation for creating the keys in a struct used to preserve the case of the key.</p>
  
  <pre><code>&lt;cfset var response = structNew()&gt;
  &lt;cfset response[ "error" ] = 0&gt;
  &lt;cfset response[ "message" ] = ""&gt;
  &lt;!--- this worked when converting this struct to a JSON
  </code></pre>
  
  <p>So when I actually put some data into the struct:</p>
  
  <pre><code>&lt;cfset response.error = 1&gt;
  &lt;cfset response.message = "There was an error inserting the record..."&gt;
  </code></pre>
  
  <p>I surprised when I saw this come across the firebug console:</p>
  
  <p><code>{"MESSAGE":"There was an error inserting the record...","ERROR":1}</code></p>
  
  <p>note, the information is what I was expecting to see.</p>
  
  <p>I understand if I would have used <code>&lt;cfset response.error = 0&gt;</code>, for the case not to be preserved when converting it to a JSON, but this has worked for me in the past.  Am I doing something wrong that I'm blind to or did something change in CF10?</p>
  
  <p>EDIT:</p>
  
  <p>Before all of the responses came back, I tried what everyone said.</p>
  
  <pre><code>&lt;cfset response["error"] = 1&gt;
  &lt;cfset response["message"] = "There was an error inserting the record..."&gt;
  </code></pre>
  
  <p>and it worked. So, I'm guessing they changed how <code>serializeJSON</code> works in CF10.</p>
  
  <p>Good to know.</p>