0

I have facing issue while reading xml file. At the start of file it will append unwanted character..like ï»؟< xml file is like 25000 lines I used below code..

br = new BufferedReader(new FileReader("XXXXX.xml"));

            while ((sCurrentLine = br.readLine()) != null) {
                //System.out.println(sCurrentLine);
                sb.append(sCurrentLine);
            }

Please help to solve this. How can I remove unwanted character?

user3855589
  • 1,113
  • 2
  • 15
  • 43
  • 3
    Possible duplicate of [Byte order mark screws up file reading in Java](http://stackoverflow.com/questions/1835430/byte-order-mark-screws-up-file-reading-in-java) – resueman Mar 16 '16 at 15:03
  • thanks for reply it append character like ? < how to avoid this? – user3855589 Mar 16 '16 at 15:16
  • Please show how you are initializing sb. Are you passing an argument to the constructor? – BPS Mar 16 '16 at 16:11

0 Answers0