• Post Reply Bookmark Topic Watch Topic
  • New Topic

CTRL-M and CTRL-J characters in files  RSS feed

 
Manish Hatwalne
Ranch Hand
Posts: 2596
Android Firefox Browser Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I uses Windows 200 machine and use Jcreator LE for my Java code. When I am
adding files to CVS using WinCVS client, somehow other memebers of team
using Linux machines are getting ^M^J in their files. Why is it happening
and moreover how can I get rid of this automatically while checking-in and
checking-out fiiles.
There is a settings in WinCVS preferences Global tab which has a checkbox
"Checkout text files with the Unix LF (0xa)" and I already have this
checkbox checked.
What should I do to avoid this problem?
TIA,
- Manish
 
Layne Lund
Ranch Hand
Posts: 3061
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Are you creating these files with the ^M and ^J characters? Even if you checked out previous revisions and checked in your updates, I suspect these characters come from the way Windows deals with text files. I'm not familiar with CVS tools for Windows, but I would suggest you look for an option such as "checkin text files with Unix LF".
In case your interested, the problem is the difference between how the two operating systems define end-of-line. In Java-like parlence, Windows/DOS uses two characters "\r\n" but Unix only uses "\n". The ^M comes from the extra "\r" character.
I haven't seen ^J before, but as I said earlier, I'm not familiar with CVS under Windows.
HTH
Layne
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!