开发者

How to simulate carriage return (HEX 0A) in ASCII or normal text?

i am required to simulate a carriage return (0A) to save into the database from a web application so that开发者_StackOverflow中文版 i can prove that the system is not cleaning data causing some issues, this needs to be entered in the browser as a plain text, are we able to do this?


I don't know what you are trying to achieve, but here's an article that uses CHAR() function in SQL query http://msdn.microsoft.com/en-us/library/ms187323.aspx

insert into mytable(mytext) values('Dear Sir:' + CHAR(13)+CHAR(10) + 'This is')

Line feed char(10)

Carriage return char(13)


Line feed char(10) is correct

Carriage return char(13) is giving issues.


From this question: What character represents a new line in a text area

By HTML specifications, browsers are required to canonicalize line breaks in user input to CR LF (\r\n).

Hence, you can't insert any other style of newline through a browser.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜