From: Rob Biedenharn Date: 2008-10-01T13:29:10+09:00 Subject: Re: JSON.parse and unicode escape? That's not valid Unicode. See: http://www.unicode.org/charts/PDF/UDC00.pdf You can only have that code point in UTF-16 -Rob On Oct 1, 2008, at 12:18 AM, pwever wrote: > I am running into what seems to be a related problem with the > following code: > > irb >>> require 'json' > => true >>> JSON.parse('{"s":"\uddb0"}') > JSON::ParserError: source sequence is illegal/malformed near uddb0"} > from /Library/Ruby/Gems/1.8/gems/json-1.1.3/lib/json/common.rb:122:in > `parse' > from /Library/Ruby/Gems/1.8/gems/json-1.1.3/lib/json/common.rb:122:in > `parse' > from (irb):2 > from :0 >>> > > I don't know enough about unicode to really understand what is being > escaped here, but the following unicode characters, very close in > range (I assume) do not throw an error: > "\ucdb0", "\uedb0", "\ud7b0" > > I also validated the JSON string ('{"s":"\uddb0"}') successfully at > http://www.jsonlint.com/ and in Python. > > Any ideas of what might be the problem? > Are there any alternative JSON parsers for ruby? > > Thank you very much // pascal > >