<?xml version="1.0" encoding="UTF-8"?>
<ticket>
  <assigned-user-id type="integer" nil="true"></assigned-user-id>
  <attachments-count type="integer">1</attachments-count>
  <closed type="boolean">true</closed>
  <created-at type="datetime">2009-06-29T08:52:01+01:00</created-at>
  <creator-id type="integer">17407</creator-id>
  <milestone-due-on type="datetime" nil="true"></milestone-due-on>
  <milestone-id type="integer">9903</milestone-id>
  <number type="integer">2849</number>
  <permalink>encode-json-in-utf-8-instead-of-binary</permalink>
  <priority type="integer">1942</priority>
  <project-id type="integer">8994</project-id>
  <raw-data type="binary" nil="true" encoding="base64"></raw-data>
  <state>resolved</state>
  <tag>3.0 activesupport encoding json ruby1.9</tag>
  <title>Encode JSON in UTF-8 instead of BINARY</title>
  <updated-at type="datetime">2009-07-02T00:27:46+01:00</updated-at>
  <user-id type="integer">17393</user-id>
  <user-name>Repository</user-name>
  <creator-name>Akira Matsuda</creator-name>
  <url>http://rails.lighthouseapp.com/projects/8994/tickets/2849</url>
  <milestone-title>2.x</milestone-title>
  <original-body>Since [default internal and external encodings are set to UTF-8 now](http://github.com/rails/rails/commit/cf3ccd7be0caae67dfddf5bc5056dcfdaab6f369) (IMO, this is quite a good decision), JSON encoding doesn't have to be BINARY [here](http://github.com/rails/rails/commit/30a3b6b4fc56390eec762c879644c95cd09622b0).

And, String#encode! is enough for transcoding here because every JSON text is expected to be encoded in Unicode according to [the JSON RFC](http://www.ietf.org/rfc/rfc4627.txt).

Attached a patch.</original-body>
  <latest-body>Since [default internal and external encodings are set to UTF-8 now](http://github.com/rails/rails/commit/cf3ccd7be0caae67dfddf5bc5056dcfdaab6f369) (IMO, this is quite a good decision), JSON encoding doesn't have to be BINARY [here](http://github.com/rails/rails/commit/30a3b6b4fc56390eec762c879644c95cd09622b0).

And, String#encode! is enough for transcoding here because every JSON text is expected to be encoded in Unicode according to [the JSON RFC](http://www.ietf.org/rfc/rfc4627.txt).

Attached a patch.</latest-body>
  <original-body-html>&lt;div&gt;&lt;p&gt;Since &lt;a href=&quot;http://github.com/rails/rails/commit/cf3ccd7be0caae67dfddf5bc5056dcfdaab6f369&quot;&gt;
default internal and external encodings are set to UTF-8 now&lt;/a&gt;
(IMO, this is quite a good decision), JSON encoding doesn't have to
be BINARY &lt;a href=&quot;http://github.com/rails/rails/commit/30a3b6b4fc56390eec762c879644c95cd09622b0&quot;&gt;
here&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;And, String#encode! is enough for transcoding here because every
JSON text is expected to be encoded in Unicode according to
&lt;a href=&quot;http://www.ietf.org/rfc/rfc4627.txt&quot;&gt;the JSON RFC&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;Attached a patch.&lt;/p&gt;&lt;/div&gt;</original-body-html>
  <versions type="array">
    <version type="Ticket::Version">
      <assigned-user-id type="integer" nil="true"></assigned-user-id>
      <attachments-count type="integer">0</attachments-count>
      <body>Since [default internal and external encodings are set to UTF-8 now](http://github.com/rails/rails/commit/cf3ccd7be0caae67dfddf5bc5056dcfdaab6f369) (IMO, this is quite a good decision), JSON encoding doesn't have to be BINARY [here](http://github.com/rails/rails/commit/30a3b6b4fc56390eec762c879644c95cd09622b0).

And, String#encode! is enough for transcoding here because every JSON text is expected to be encoded in Unicode according to [the JSON RFC](http://www.ietf.org/rfc/rfc4627.txt).

Attached a patch.</body>
      <body-html>&lt;div&gt;&lt;p&gt;Since &lt;a href=
&quot;http://github.com/rails/rails/commit/cf3ccd7be0caae67dfddf5bc5056dcfdaab6f369&quot;&gt;
default internal and external encodings are set to UTF-8 now&lt;/a&gt;
(IMO, this is quite a good decision), JSON encoding doesn't have to
be BINARY &lt;a href=
&quot;http://github.com/rails/rails/commit/30a3b6b4fc56390eec762c879644c95cd09622b0&quot;&gt;
here&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;And, String#encode! is enough for transcoding here because every
JSON text is expected to be encoded in Unicode according to
&lt;a href=&quot;http://www.ietf.org/rfc/rfc4627.txt&quot;&gt;the JSON RFC&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;Attached a patch.&lt;/p&gt;&lt;/div&gt;</body-html>
      <closed type="boolean">false</closed>
      <created-at type="datetime">2009-06-29T08:52:01+01:00</created-at>
      <creator-id type="integer">17407</creator-id>
      <diffable-attributes type="yaml">--- {}

</diffable-attributes>
      <milestone-id type="integer">9903</milestone-id>
      <number type="integer">2849</number>
      <permalink>encode-json-in-utf-8-instead-of-binary</permalink>
      <priority type="integer">0</priority>
      <project-id type="integer">8994</project-id>
      <state>new</state>
      <tag>3.0 activesupport encoding json ruby1.9</tag>
      <title>Encode JSON in UTF-8 instead of BINARY</title>
      <updated-at type="datetime">2009-06-29T08:52:05+01:00</updated-at>
      <user-id type="integer">17407</user-id>
      <user-name>Akira Matsuda</user-name>
      <creator-name>Akira Matsuda</creator-name>
      <url>http://rails.lighthouseapp.com/projects/8994/tickets/2849</url>
      <milestone-title>2.x</milestone-title>
    </version>
    <version type="Ticket::Version">
      <assigned-user-id type="integer" nil="true"></assigned-user-id>
      <attachments-count type="integer">1</attachments-count>
      <body>(from [49824e8ad64be17d6b8a0356bc30342aecc72216]) JSON.escape returns UTF-8 strings

[#2849 state:resolved]
http://github.com/rails/rails/commit/49824e8ad64be17d6b8a0356bc30342aecc72216</body>
      <body-html>&lt;div&gt;&lt;p&gt;(from &lt;a href=
&quot;/projects/8994/changesets/49824e8ad64be17d6b8a0356bc30342aecc72216&quot;
title=
&quot;Changeset [49824e8ad64be17d6b8a0356bc30342aecc72216]&quot;&gt;[49824e8ad64be17d6b8a0356bc30342aecc72216]&lt;/a&gt;)
JSON.escape returns UTF-8 strings&lt;/p&gt;
&lt;p&gt;[&lt;a href=&quot;/projects/8994/tickets/2849&quot; title=
&quot;Ticket #2849&quot;&gt;#2849&lt;/a&gt; state:resolved] &lt;a href=
&quot;http://github.com/rails/rails/commit/49824e8ad64be17d6b8a0356bc30342aecc72216&quot;&gt;
http://github.com/rails/rails/commit/49824e8ad64be17d6b8a0356bc3034...&lt;/a&gt;&lt;/p&gt;&lt;/div&gt;</body-html>
      <closed type="boolean">true</closed>
      <created-at type="datetime">2009-07-02T00:22:52+01:00</created-at>
      <creator-id type="integer">17407</creator-id>
      <diffable-attributes type="yaml">--- 
:state: new
</diffable-attributes>
      <milestone-id type="integer">9903</milestone-id>
      <number type="integer">2849</number>
      <permalink>encode-json-in-utf-8-instead-of-binary</permalink>
      <priority type="integer">0</priority>
      <project-id type="integer">8994</project-id>
      <state>resolved</state>
      <tag>3.0 activesupport encoding json ruby1.9</tag>
      <title>Encode JSON in UTF-8 instead of BINARY</title>
      <updated-at type="datetime">2009-07-02T00:22:54+01:00</updated-at>
      <user-id type="integer">17393</user-id>
      <user-name>Repository</user-name>
      <creator-name>Akira Matsuda</creator-name>
      <url>http://rails.lighthouseapp.com/projects/8994/tickets/2849</url>
      <milestone-title>2.x</milestone-title>
    </version>
    <version type="Ticket::Version">
      <assigned-user-id type="integer" nil="true"></assigned-user-id>
      <attachments-count type="integer">1</attachments-count>
      <body>(from [5217c16b094a07919348b52aa164ca2fd26b5d5e]) JSON.escape returns UTF-8 strings

[#2849 state:resolved]
http://github.com/rails/rails/commit/5217c16b094a07919348b52aa164ca2fd26b5d5e</body>
      <body-html>&lt;div&gt;&lt;p&gt;(from &lt;a href=
&quot;/projects/8994/changesets/5217c16b094a07919348b52aa164ca2fd26b5d5e&quot;
title=
&quot;Changeset [5217c16b094a07919348b52aa164ca2fd26b5d5e]&quot;&gt;[5217c16b094a07919348b52aa164ca2fd26b5d5e]&lt;/a&gt;)
JSON.escape returns UTF-8 strings&lt;/p&gt;
&lt;p&gt;[&lt;a href=&quot;/projects/8994/tickets/2849&quot; title=
&quot;Ticket #2849&quot;&gt;#2849&lt;/a&gt; state:resolved] &lt;a href=
&quot;http://github.com/rails/rails/commit/5217c16b094a07919348b52aa164ca2fd26b5d5e&quot;&gt;
http://github.com/rails/rails/commit/5217c16b094a07919348b52aa164ca...&lt;/a&gt;&lt;/p&gt;&lt;/div&gt;</body-html>
      <closed type="boolean">true</closed>
      <created-at type="datetime">2009-07-02T00:27:45+01:00</created-at>
      <creator-id type="integer">17407</creator-id>
      <diffable-attributes type="yaml">--- {}

</diffable-attributes>
      <milestone-id type="integer">9903</milestone-id>
      <number type="integer">2849</number>
      <permalink>encode-json-in-utf-8-instead-of-binary</permalink>
      <priority type="integer">0</priority>
      <project-id type="integer">8994</project-id>
      <state>resolved</state>
      <tag>3.0 activesupport encoding json ruby1.9</tag>
      <title>Encode JSON in UTF-8 instead of BINARY</title>
      <updated-at type="datetime">2009-07-02T00:27:46+01:00</updated-at>
      <user-id type="integer">17393</user-id>
      <user-name>Repository</user-name>
      <creator-name>Akira Matsuda</creator-name>
      <url>http://rails.lighthouseapp.com/projects/8994/tickets/2849</url>
      <milestone-title>2.x</milestone-title>
    </version>
  </versions>
  <attachments type="array">
    <attachment type="Attachment">
      <code>7dc3eef9ff109ed10214b58452d9c16f5d4c43ab</code>
      <content-type>text/plain</content-type>
      <created-at type="datetime">2009-06-29T08:52:01+01:00</created-at>
      <filename>json_binary_encoding_fix.diff</filename>
      <height type="integer" nil="true"></height>
      <id type="integer">138543</id>
      <size type="integer">1208</size>
      <uploader-id type="integer">17407</uploader-id>
      <width type="integer" nil="true"></width>
      <url>http://rails.lighthouseapp.com/attachments/138543/json_binary_encoding_fix.diff</url>
    </attachment>
  </attachments>
</ticket>
