How can we fix the below issue reported by findBugs:
Found reliance on default encoding in abc.java : new java.io.FileReader(File)
I'm just reading file & Findbug has reported the issue.
Any help is much appreciated!
use an explicit character encoding when opening a file instead of relying on the platform default (which can change depending on the platform), unless of course, you intend to use the platform default. you can use InputStreamReader
to convert a FileInputStream
to a Reader
using an explicit character encoding.