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

user1182583
  • 191
  • 1
  • 10
  • 1
    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

1 Answers1

0

There are a few options mentioned in this question/answer that I think could help here.

Byte order mark screws up file reading in Java

Community
  • 1
  • 1
Cris Holdorph
  • 319
  • 1
  • 5