The problem is that what you parse is not valid JSON, check the standard on <a href="http://json.org">json.org</a>.<br><br>Lukas<br><br>On Monday, 12 September 2011, Sebastian Sastre <<a href="mailto:sebastian@flowingconcept.com">sebastian@flowingconcept.com</a>> wrote:<br>
> Maybe this is useful to someone:<br>> Try this:<br>> JSJsonParser parseStream: '{lhs: "1 Brazil real",rhs: "0.592768 U.S. dollars",error: "",icc: true}' readStream<br>> it can't parse that, so..<br>
> ...patch it with this:<br>> JSJsonParser#parseProperty<br>> | name value |<br>> name := self parsePropertyName.<br>> value := self parseValue.<br>> ^ self createProperty: name with: value.<br>> JSJsonParser#parsePropertyName<br>
> | result |<br>> result := WriteStream on: String new.<br>> [ stream atEnd or: [ stream peek = $: ] ] <br>> whileFalse: [ result nextPut: self parseCharacter ].<br>> ^ self expect: ':'; createString: result contents<br>
> then you get it working like this:<br>> a Dictionary('error'->'' 'icc'->true 'lhs'->'1 Brazil real' 'rhs'->'0.592768 U.S. dollars' )<br>> sebastian <<a href="http://about.me/sebastianconcept">http://about.me/sebastianconcept</a>><br>
> o/<br>><br>><br>><br><br>-- <br>Lukas Renggli<br><a href="http://www.lukas-renggli.ch">www.lukas-renggli.ch</a><br>