|
Hi,
Please look at the attached files. The program first checks if this is a
unicode file. If it is, it opens it using "ISO..." encoding and uses a
UnicodeIgnoreByteReader to read from the file. This Reader extends InputStream
Reader and overrides the read(...) method by returning only every alternate
character (which should be valid ASCII if this is UTF-8 encoding which is mostly
used in Windows).
Then, if this is not a unicode file, the program tries to open it using
"ISO..." encoding (this is for the JAR and other binary files). If this also
fails, the file is a text file and can be opened using default encoding.
Any comments / critisizms on the code are welcome.
Hardeep Singh
http://SeeingWithC.cjb.net |
UnicodeIgnoreByteReader.java
Description: Binary data
Emails.java
Description: Binary data
-- To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>
