4 ms·
I think the line endings support is going to be the most valuable addition, that's definitely bitten me when I used to use Windows.
by KwanEsq 8y ago
I think the line endings support is going to be the most valuable addition, that's definitely bitten me when I used to use Windows.
- stephengillie 8y agoParsing can be "fun", trying to figure out if text is ended with \n, \r, or both.
- marcosdumay 8y agoUnix's \n, Windows' \r\n, and older Mac's \n\r. Deciding whether a line-end terminated when reading from a network is kinda hard...
- Avery3R 8y agoolder macs are just \r not \n\r
- nojvek 8y ago\r?\n regex?
- bmn__ 8y agoNo, you want \R, the generic Unicode linebreak sequence. http://pcre.org/current/doc/html/pcre2pattern.html#newlineseq http://pcre.org/current/doc/html/pcre2pattern.html#newlinese... http://p3rl.org/rebackslash#\R http://p3rl.org/rebackslash#\R
- marcosdumay 8y agoSo, you take a `\r` from the network. So, do you wait for a `\n` before returning the line?
- rhencke 8y agoYou wait to peek the next byte, or EOF, and then make the choice.
- marcosdumay 8y agoLine protocols do not transmit EOF (and the problem is on each line anyway). And the next byte may only come after you write something on the socket.