I am developing on PHPandAPACHE on windows xampp environment.
I have some files I read and write to.
I do use definitions of NEWLINES (\r\n for Windows, \n for UNIX), but isn’t it that when I port to UNIX I am going to have to convert all these files to UNIX text formats?
Is this not a door to lots of weird annoying bugs ?
Thanks
Yes, this can be any annoying problem. You will need address it somehow. I wrote my own C++ utility using fstream/sstream, but there are lots of solutions out there. There’s actually a stack overflow which mentions a few ways to do this:
How to convert DOS/Windows newline (CRLF) to Unix newline (\n) in a Bash script?