Closed LandonSchropp closed 10 years ago
Hm, I don't think this is true. Your character doesn't need to be escaped in code, since (IIRC) strings in Ruby are UTF8 anyway. Ex: BW::JSON.parse('{"symbol": "€"}')
works fine
I encountered this problem when parsing a response from an external server I have no control over. Since the code is valid in Ruby, I feel like this use case should be supported.
Did a bit more research, and your server is sending invalid JSON. This is not a BubbleWrap problem - it would fail if you used other JSON parsers.
The JSON spec states that characters should be encoded as \u____
. From the JSON spec:
BW::JSON.parse("[ \"hello\" ]")
produces["hello"]
, butBW::JSON.parse("[ \"hello\x80\" ]")
produces the following error: