crucialfelix / API

simple Application Programming Interface framework for inter-application communication with SuperCollider
17 stars 3 forks source link

JSON: newlines and tabs disappear in strings #2

Open nhthn opened 8 years ago

nhthn commented 8 years ago
JSON.stringify("a\n\t")
  -> "a"
crucialfelix commented 8 years ago

would be nice if we had JSON in the core.

I should check if the JSON implementation in SuperColliderJS (the bridge class) has this problem.

thanks for the report.

nhthn commented 8 years ago

JSON should def be in core. super popular format in this decade.

nhthn commented 8 years ago

the bug is because of .reject(_.isControl) in https://github.com/crucialfelix/API/blob/master/JSON.sc#L14. \n and \t are control characters