Some conflict when using JSON Pure to create a JSON string from a Hash with 
non-ASCII character
-----------------------------------------------------------------------------------------------

                 Key: JRUBY-1530
                 URL: http://jira.codehaus.org/browse/JRUBY-1530
             Project: JRuby
          Issue Type: Bug
          Components: Extensions
    Affects Versions: JRuby 1.1b1
         Environment: Linux Ubuntu, 
java version "1.6.0_03"
Java(TM) SE Runtime Environment (build 1.6.0_03-b05)
Java HotSpot(TM) Client VM (build 1.6.0_03-b05, mixed mode, sharing)

            Reporter: Joao Pedrosa


Notice the difference between
{"name":"Cora\u0043\u006f\u0072\u0061o"}
and
{"name":"Cora\u00e7\u00e3o"}

This causes a conflict for me when generating some translation files which use 
JSON from JRuby.

[EMAIL PROTECTED]:~/loose/t_/jruby$ cat enc_json.rb 
require 'rubygems'
gem 'json_pure'
require 'json'
h = {'name' => 'Coração'} #"Coração" in Portuguese - heart in English :-)
s = h.to_json
puts s
[EMAIL PROTECTED]:~/loose/t_/jruby$ jruby -v enc_json.rb 
ruby 1.8.5 (2007-11-05 rev 4842) [i386-jruby1.1b1]
{"name":"Cora\u0043\u006f\u0072\u0061o"}
[EMAIL PROTECTED]:~/loose/t_/jruby$ ruby -v enc_json.rb 
ruby 1.8.6 (2007-09-23 patchlevel 110) [i686-linux]
{"name":"Cora\u00e7\u00e3o"}
[EMAIL PROTECTED]:~/loose/t_/jruby$

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: 
http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira



---------------------------------------------------------------------
To unsubscribe from this list please visit:

    http://xircles.codehaus.org/manage_email

Reply via email to