From mboxrd@z Thu Jan 1 00:00:00 1970 To: 9fans@cse.psu.edu From: Saroj Mahapatra Message-ID: <6d3220b4.0302221754.17fc79a@posting.google.com> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit Subject: [9fans] libbio and CR-LF Date: Mon, 24 Feb 2003 10:00:32 +0000 Topicbox-Message-UUID: 701a2fcc-eacb-11e9-9e20-41e7f4b1d025 I have been thinking about adapting libbio for Windows platform. There are basically two approaches. One can remove CR-LF when reading from the file, or one can keep the CR-LF and Bget can return a '\n' when it sees CR-LF. Neither approach is perfect. In the first case, file offset + icount is messed up. In the second case, Bunget will have to change '\n' to CR-LF. It (Bunget) still can not handle mixed line terminators 'CR-LF' and CR (See 'getcsv' in "Practice Of Programming" for an example). Leaving the handling of CR-LF to the application programs is one option (though not very pleasing). Still a different approach is to use programs like dos2unix and unix2dos. But if you are dealing with a network protocol like http or New York Stock Exchange CMS format messages, dos2unix and unix2dos do not help. What do guys here think about this? Thanks, Saroj Mahapatra