cblage/elixir-json — pull request #7 by parroty (2013-09-03 15:58:33+00:00)
Title: fix encoding for string with \\

Hi. I was encoding the string with "\n" using elixir-json, and facing a behavior which is different from other json libraries. I'm not sure enough if it's a correct (intentional) or not, but trying to fix. What do you think?

elixir-json
```
iex(2)> JSON.encode!(["\n"])
"[\"\\n\"]"
iex(3)> JSON.encode!(["\\n"])
"[\"\\n\"]"
```

ruby 1.9.2
```
1.9.2-p290 :001 > require 'json'
=> true
1.9.2-p290 :002 > JSON.generate(["\n"])
=> "[\"\\n\"]"
1.9.2-p290 :003 > JSON.generate(["\\n"])
=> "[\"\\\\n\"]"
```

Python 2.7.2
```
Python 2.7.2 (default, Oct 11 2012, 20:14:37)
[GCC 4.2.1 Compatible Apple Clang 4.0 (tags/Apple/clang-418.0.60)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import json
>>> json.dumps(["\n"])
'["\\n"]'
>>> json.dumps(["\\n"])
'["\\\\n"]'
```