Re: [Lift] Re: lift-json escaping bug

2009-12-01 Thread Ross Mellgren
Fixed: d977c95589fbd5de8bc45e43c2867097dd75a807 -Ross On Nov 30, 2009, at 8:33 PM, harryh wrote: > Done: > > http://github.com/dpp/liftweb/issues/#issue/214 > > On Nov 30, 6:33 pm, Ross Mellgren wrote: >> If you file an issue on github I'll write up a patch for you tonight. >> >> -Ross >>

[Lift] Re: lift-json escaping bug

2009-11-30 Thread Joni Freeman
Hi, This is from JSON RFC (http://www.ietf.org/rfc/rfc4627.txt): "A JSON text is a serialized object or array." I checked with another parser (http://www.jsonlint.com) and it fails too when given just JSON value: "syntax error, unexpected TNUMBER, expecting '{' or '[' at line 1" So perhaps a bet

Re: [Lift] Re: lift-json escaping bug

2009-11-30 Thread Ross Mellgren
On review board: http://reviewboard.liftweb.net/r/131/ I did run across another infelicity when writing the test -- apparently JsonParser crashes when given a scalar value, as opposed to an array or object: scala> parse("\"foobar\"") net.liftweb.json.JsonParser$ParseException: unexpected null Ne

[Lift] Re: lift-json escaping bug

2009-11-30 Thread harryh
Done: http://github.com/dpp/liftweb/issues/#issue/214 On Nov 30, 6:33 pm, Ross Mellgren wrote: > If you file an issue on github I'll write up a patch for you tonight. > > -Ross > > On Nov 30, 2009, at 6:30 PM, harryh wrote: > > > Yes, what Ross said.  Further, taking a look at JsonParser.scala t

Re: [Lift] Re: lift-json escaping bug

2009-11-30 Thread Ross Mellgren
What I find particularly interesting is that the JSON spec lacks \', but gains \/, relative to the ECMA-262 (javascript) spec that JSON supposedly derives from. -Ross On Nov 30, 2009, at 6:34 PM, Nathan Folkman (Foursquare) wrote: > Here's the complete list from http://json.org/: > > char: >

[Lift] Re: lift-json escaping bug

2009-11-30 Thread Nathan Folkman (Foursquare)
Here's the complete list from http://json.org/: char: Any Unicode character except " or \ or control-character. \" \\ \/ \b \f \n \r \t \u four-hex-digits - n On Nov 30, 6:30 pm, harryh wrote: > Yes, what Ross said.  Further, taking a look at JsonParser.scala the > bug appears to be on line ~

Re: [Lift] Re: lift-json escaping bug

2009-11-30 Thread Ross Mellgren
If you file an issue on github I'll write up a patch for you tonight. -Ross On Nov 30, 2009, at 6:30 PM, harryh wrote: > Yes, what Ross said. Further, taking a look at JsonParser.scala the > bug appears to be on line ~202 where there are a couple of missing > escape sequences: \/ as well as \f.

[Lift] Re: lift-json escaping bug

2009-11-30 Thread harryh
Yes, what Ross said. Further, taking a look at JsonParser.scala the bug appears to be on line ~202 where there are a couple of missing escape sequences: \/ as well as \f. -harryh On Nov 30, 6:20 pm, Ross Mellgren wrote: > He's double escaping so that scala's string interpretation will put a   >

Re: [Lift] Re: lift-json escaping bug

2009-11-30 Thread Ross Mellgren
He's double escaping so that scala's string interpretation will put a raw \ in there, so that it's an escaped forward slash (\/) to the JSON parson, as I understand it. The output should be either invalid escape or forward slash, but not backslash unless the input was \\. -Ross On Nov 30, 2

[Lift] Re: lift-json escaping bug

2009-11-30 Thread Peter Robinett
Harry, I think you're double-escaping the slash. This works: scala> import net.liftweb.json._ scala> val s1 = "{ \"id\": \"America/New_York\" }" s1: java.lang.String = { "id": "America/New_York" } scala> JsonParser.parse(s1) res0: net.liftweb.json.JsonAST.JValue = JObject(List(JField(id,JString (A