Re: linebreak differences between Linux and Windows
Posted by:
Rick James
Date: August 18, 2014 06:26PM
Within MySQL, there are essentially no differences between Operating Systems; at least none exposed to the end user.
If you are having trouble with LF vs CRLF, then you stored them in a table. MySQL faithfully gave you back what you stored. So, there is no difference than if you had done some kind of binary copy between the Operating Systems.
If you are dealing with UIs, then HTML is the standard to follow; it has "no" issues with LF vs CRLF -- whitespace is whitespace, and whitespace collapses down to a single space. "<BR>" gives you a new line. "<PRE>" does recognize LF and CR, so beware. The Browsers become the problem -- IE, FF, etc, render things slightly differently.
If you are echoing to a 'dumb terminal' or DOS commandline, then you need to understand the differences there. Again, MySQL is not involved.
> which I update from time to time through a SQL import
What kind of data are you importing? Numbers--no problem. Layout-- well, that is what I discussed above.
The "right" way to design something that needs different renderings in different places is to put clues into the data, and then have code on the frontend to act on those clues. That does get messy if you want to display on big screens versus small cellphones. In that case, some of the logic needs to be in the application code.