-
Notifications
You must be signed in to change notification settings - Fork 362
Closed
Description
When the Ruby string contains a Unicode Line Separator character (http://www.fileformat.info/info/unicode/char/2028/index.htm), this library incorrectly generates the final JSON, which causes SyntaxError: Unexpected token ILLEGAL (in Chrome) and Unexpected EOF in Safari, etc.
"Home by Edward Sharpe & the Magnetic Zeros\u2028".to_json
# "\"Home by Edward Sharpe \\u0026 the Magnetic Zeros\u2028\""should be
# "\"Home by Edward Sharpe \\u0026 the Magnetic Zeros\\u2028\""As far as I can tell, the JSON spec and browsers treat U+2028/2029 as valid line separator characters, which are not allowed to occur within strings.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels