4

I edit in notepad cfg.prop file

cfg.prop:

key=val

my code:
    Properties prop = new Properties();
    prop.load(new InputStreamReader(new FileInputStream("etc/agent.prop"), "UTF-8"));
    System.out.println(prop);

then I see in stdout {?key=val}, becose notepad save UTF-8 file with BOM character (efbbbf) how to ignore this character? I use java6u21

Community
  • 1
  • 1
user1182583
  • 191
  • 1
  • 10
  • 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) – icza Aug 11 '14 at 08:52
  • I solved it just add new line in the beginning. Who knows cleaner solution – user1182583 Aug 11 '14 at 09:02

0 Answers0