mpx / lua-cjson

Lua CJSON is a fast JSON encoding/parsing module for Lua

Home Page:https://kyne.au/~mark/software/lua-cjson.php

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

lua-cjson escapes slashes

vitek opened this issue · comments

Hi!

Why does lua-cjson escape slashes:

> cjson = require 'cjson'
> print(cjson.encode('/'))
"\/"

Is that a bug?

No, it's not. See the grammar at http://www.json.org/

/ is valid. / is valid too.

so / is a control-character then...