I am using a BufferedReader
to read details from a file which are stored as bytes, I am then converting the bytes
into text and splitting it into an
What you see is the UTF-8 BOM
Convert your input file to be without BOM.
white spaces may cos this error. try to trim()
the input line while reading line,
like,
line = bufferedReader.readLine().trim();
Follow this code:
String lineFromFile = bufferedReader.readLine();
// strip out the `[` and `]`
lineFromFile = lineFromFile.substring(1, lineFromFile.length()-1);
StringBuilder sb = new StringBuilder();
for(String s: lineFromFile.split(", "))
sb.append((char) Integer.parseInt(s));
String text = sb.toString();