[clarinet] string escaping #1

Closed
thejh opened this Issue Jan 17, 2012 · 4 comments

Comments

Projects
None yet
2 participants
@thejh
Collaborator

thejh commented Jan 17, 2012

Well, no clarinet here, can't test stuff, but looks to me like we're just stripping backslashes from strings, not interpreting \u0000 or so.

@ghost ghost assigned thejh Jan 17, 2012

@thejh

This comment has been minimized.

Show comment
Hide comment
@thejh

thejh Jan 17, 2012

Collaborator

Either a bunch of new states and stuff... or we cache the string with quotes and everything and then use JSON.parse on it.

Collaborator

thejh commented Jan 17, 2012

Either a bunch of new states and stuff... or we cache the string with quotes and everything and then use JSON.parse on it.

@dscape

This comment has been minimized.

Show comment
Hide comment
@dscape

dscape Jan 17, 2012

Owner

@thejh No, we deal with \u0000 fine I think:

https://github.com/dscape/clarinet/blob/master/test/clarinet.js#L35-#L44

If you think that test case is wrong and not running for some reason then we should fix this bug :)

Owner

dscape commented Jan 17, 2012

@thejh No, we deal with \u0000 fine I think:

https://github.com/dscape/clarinet/blob/master/test/clarinet.js#L35-#L44

If you think that test case is wrong and not running for some reason then we should fix this bug :)

@thejh

This comment has been minimized.

Show comment
Hide comment
@thejh

thejh Jan 17, 2012

Collaborator
parser.write('{"a": "\\u0000"}').close();
OPEN a
VALUE u0000
CLOSE
END

Compare it to v8s JSON.parse:

> JSON.parse('{"a": "\\u0000"}')
{ a: '\u0000' }

http://json.org/ has a spec. We have to recognize backslash followed by one control character and backslash followed by u and four digits. And parse that stuff.

Collaborator

thejh commented Jan 17, 2012

parser.write('{"a": "\\u0000"}').close();
OPEN a
VALUE u0000
CLOSE
END

Compare it to v8s JSON.parse:

> JSON.parse('{"a": "\\u0000"}')
{ a: '\u0000' }

http://json.org/ has a spec. We have to recognize backslash followed by one control character and backslash followed by u and four digits. And parse that stuff.

@thejh

This comment has been minimized.

Show comment
Hide comment
@thejh

thejh Jan 17, 2012

Collaborator

Fixed.

Collaborator

thejh commented Jan 17, 2012

Fixed.

@thejh thejh closed this Jan 17, 2012

dscape pushed a commit that referenced this issue Dec 17, 2014

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment