Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Newline problem in page

Status
Not open for further replies.

leujel

Programmer
May 28, 2003
23
0
0
NL
Before I begin, excuse me for my bad english...

I'm programming a PHP website on my desktop pc (Windows XP, working in Notepad++). The files ar located on a local webserver (Linux Red Hat 9). When I edit the files with my desktop pc and save them, the don't work anymore on Linux webservers. What I found out was that the breaks or white lines in the page are replaced by ^M as soon as I save a file.

Looks like there is something going wrong with the conversion from windows to Linux. The weird thing is, that I don't see these characters when opening the file in windows, it all seems just fine, but when opening them with VI editor in Linux or widnows own notepad... You got the point I guess.

Does anybody know what the problem is and how to solve it? I've tried several editors, but I can't seem to find a answer to this problem.

Thanks in advance.

---------------

Visit Stray Cats Fan!! Go Cat!! Go!!
 
Hmmm weird.... I've installed dreamweaver, opened the file saved it, and voila, it's ok... Weird but problem solved!!

---------------

Visit Stray Cats Fan!! Go Cat!! Go!!
 
In case you still wondering what was going on, what you were looking at were carriage returns (\r). Linux doesn't like them. You have to remove them or save the file using Unix line endings.

---------------------------------------
TINSTAAFL, which is why I contribute.
 
The core problem is the difference in designating the end of a line.

Win32 uses <carriage-return><linefeed>. Linux uses only <linefeed>.



Want the best answers? Ask the best questions! TANSTAAFL!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top