Your may find help in a recent discussion, Quick and portable way to determine line-ending string?
You may also wish to clarify the wording of your post. You use both "platform specific line-ending" and "network line-ending." Is the use of two different phrases accidental or purposeful (and if the later, please explain)?