I discovered, when Firefox's JS开发者_StackOverflow中文版ON.stringify function converts string with line breaks it converts '\n' characters to '\u000a'. And when this data comes to server via jQuery.ajax.send instead of '\u000a' I see just a whitespace. Anyone ran into same problem? Point me in right direction, please.
The Unicode code point for a newline is U+000A. Firefox happens to choose to encode the newline into Unicode '\u000a', instead of shortening it to '\n'. According to the JSON spec, it's allowable to use the Unicode form.
Are you sure anything is actually wrong with the output? Any JSON library should be able to handle the '\u000a' just fine.
If you're debugging by wrapping the decoded JSON in HTML, a newline is equivalent to a space in places where whitespace is unimportant. E.g.
<div>this
example</div>
is equivalent to:
<div>this example</div>
精彩评论