Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Which mode shoud be used for jsp? ascii or binary

 
James Lee
Ranch Hand
Posts: 36
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

When we create a jsp in eclipse, should ascii or binary mode be used? I know the two modes are related to data transfer between local and cvs but there is no difference and impact in my project by switing them. Can anyone say something about the modes? Usually which one should be used for jsp?

Thanks.
 
Peter Johnson
author
Bartender
Posts: 5856
7
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
JSPs are text files so ascii mode would be best (though the ascii-vs-binary question brings to mind FTP and not version control where usually the issue is binary vs text, but then I don't use CVS and different products use different terminology for the same thing)
 
Mourouganandame Arunachalam
Ranch Hand
Posts: 398
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
When you check-in files into any version control systems for textual source codes you can use the default text or ascii mode, however, when check-in word doc, xls, image or class files you may need to use the binary mode.

 
Tim Holloway
Saloon Keeper
Posts: 18304
56
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The crucial differences are: A) What is the code page and B) what are the end-of-line characters.

The code page is almost always going to be ASCII unless you're working with IBM mainframes (EBCDIC).

The end-of-line characters may be CR (Macintosh), CR/LF (DOS/Windows) or LF (Unix, most others). LF is also referred to as NL (Newline).

When you indicate text mode - and this applies to both CVS and FTP - the server will translate to the appropriate code page and end-of-line sequence for yout target machine. When you indicate binary (a/k/a image) mode, the bytes will pass unmodified.

Binary mode is always safe, but because not all tools are smart, text mode is preferable when dealing with things that are 100% text. If you download a text file with in Unix mode end-of-line characters, Windows Notepad won't work right, although Wordpad and most IDE's will accommodate.

On the other hand, if you create a Unix shell script or C/C++ source file on a Windows machine and upload it in binary mode and it uses the end-of-line continuation (backslash) to semantically glue 2 lines together as though they were a single long line, binary mode will propagate the CR/LF. And most Unix tools won't like that, resulting in compile errors and scripts that won't execute.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic