You are viewing a plain text version of this content. The canonical link for it is here.
Posted to oro-dev@jakarta.apache.org by Hardeep Singh <ha...@in.velocient.com> on 2002/01/29 06:55:20 UTC

Re: Question : Solved : Discuss

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