5 added 112 characters in body
source | link

CJam, 5757 54 bytes

qL{[~]2/{{`_'{#{1>W<"\u%04x"fe%s`}{~j~J}?}/'f%':\'f*',}%W<*{}s\*}j:J

This is a named function that pops a VDF string from the stack and pushes a JSON string in return.

CJam has no JSON built-ins, so the bonus won't be worth it. Since conditionally escaping some characters would be a pain for the same reason, I decided to escape everything.

The result isn't pretty, but it's valid JSON. Try it online in the CJam interpreterCJam interpreter.

CJam, 57 bytes

qL{[~]2/{{`_'{#{1>W<"\u%04x"fe%s`}{~j}?}/':\',}%W<{}s\*}j

CJam has no JSON built-ins, so the bonus won't be worth it. Since conditionally escaping some characters would be a pain for the same reason, I decided to escape everything.

The result isn't pretty, but it's valid JSON. Try it online in the CJam interpreter.

CJam, 57 54 bytes

{[~]2/{`_'{#{1>W<"\u%04x"fe%s`}{~J}?}f%':f*',*{}s\*}:J

This is a named function that pops a VDF string from the stack and pushes a JSON string in return.

CJam has no JSON built-ins, so the bonus won't be worth it. Since conditionally escaping some characters would be a pain for the same reason, I decided to escape everything.

The result isn't pretty, but it's valid JSON. Try it online in the CJam interpreter.

4 added 170 characters in body
source | link

CJam, 41 38 3757 bytes

qL{[~]2/{:`~':\_'{`_'{#{1>W<"\u%04x"fe%s`}{~j}|'?}/':\',}%W<{}s\*}j

CJam has no JSON built-ins, so the bonus won't be worth it. Since conditionally escaping some characters would be a pain for the same reason, I decided to escape everything.

The result isn't pretty, but it's valid JSON. Try it online in the CJam interpreterCJam interpreter.

CJam, 41 38 37 bytes

qL{[~]2/{:`~':\_'{#{~j}|',}%W<{}s\*}j

CJam has no JSON built-ins, so the bonus won't be worth it. Try it online in the CJam interpreter.

CJam, 57 bytes

qL{[~]2/{{`_'{#{1>W<"\u%04x"fe%s`}{~j}?}/':\',}%W<{}s\*}j

CJam has no JSON built-ins, so the bonus won't be worth it. Since conditionally escaping some characters would be a pain for the same reason, I decided to escape everything.

The result isn't pretty, but it's valid JSON. Try it online in the CJam interpreter.

3 added 61 characters in body
source | link

CJam, 41 3838 37 bytes

qL{[~]2/{~\`':@`_'`~':\_'{#{~j}|',}%W<{}s\*}j

CJam has no JSON built-ins, so the bonus won't be worth it. Try it online in the CJam interpreterCJam interpreter.

CJam, 41 38 bytes

qL{[~]2/{~\`':@`_'{#{~j}|',}%W<{}s\*}j

CJam has no JSON built-ins, so the bonus won't be worth it. Try it online in the CJam interpreter.

CJam, 41 38 37 bytes

qL{[~]2/{:`~':\_'{#{~j}|',}%W<{}s\*}j

CJam has no JSON built-ins, so the bonus won't be worth it. Try it online in the CJam interpreter.

2 deleted 57 characters in body
source | link
1
source | link