Backbone.js adding "\u000a" in place of newline characters when posting
I have a backbone开发者_JS百科.js model which, when posted to the server, seems to be changing the newline characters (\n) to the following: \u000a
When I get into the controller action in Rails, I'm left with spaces in those places. So, the string "test\nthis\nstring" gets converted to "test\u000athis\u000astring" before it is posted, then in Rails, it shows up as "test this string".
Anyone have any ideas on what could be causing this?
\u000a is unicode for a new line, \n in your case. Double check how you are encoding your data.
精彩评论