How can I tell in Java if a file is ASCII (it contains only ASCII characters) or binary ? I mean is there another method without checking the entire content of the file ? --gica
Fred Hosch
Author
Greenhorn
Joined: Apr 16, 2001
Posts: 23
posted
0
well, in the unix world there's a magic number at the start of the file that you can check. (man magic). god only knows what things look like in the devil's workshop. ------------------ Fred Hosch Author of: An Introduction to Software Construction with Java
Fred Hosch<br />Author of:<br /><a href="http://www.amazon.com/exec/obidos/ASIN/0471354899/ref=ase_electricporkchop/107-7882751-0234939" target="_blank" rel="nofollow">An Introduction to Software Construction with Java</a>
Thomas Paul
mister krabs
Ranch Hand
Joined: May 05, 2000
Posts: 13974
posted
0
As far as I know there is no way to determine the encoding method used for a particular file.