【发布时间】:2012-03-07 15:53:52
【问题描述】:
在终端中,两者似乎没有区别
echo -en 'first\r\nsecond' 和 echo -en 'first\n\second'
但在没有 \r 的代码中它不起作用
echo -en 'GET /test HTTP/1.1\r\nHost: localhost\r\n\r\n' | nc localhost 9292
有效,但是
echo -en 'GET /test HTTP/1.1\r\nHost: localhost\n\n' | nc localhost 9292
没有
谁能解释为什么会这样?
【问题讨论】:
标签: character-encoding control-characters