I've setup a class within my software package to read generic text files. For this, I'm using the getline( ) function and then parsing each line for specific types of files.
In setting this up, I've come across the ACSII incompatibilities between Windows systems and Unix systems. I struggled for a while before realising that a text file that had been created on a Windows machine contained the return carriage, which showed up on my Mac as the ^M character.
I was wondering if there is any general, accepted way to deal with these discrepancies. Is it simply a case of detecting the operating system and having a case for each, or is there a more universal way of dealing with this discrepancy.
I'd appreciate any input.
Thanks a lot!