Why does Java ignore the first line of a .properties file?

后端 未结 2 612
傲寒
傲寒 2020-12-17 01:37

I was working with an app that loads a .properties file with java.util.Properties like this:

Properties _properties = new Propertie         


        
2条回答
  •  别那么骄傲
    2020-12-17 02:10

    Java does not handle the BOM correctly – you can see it in the properties as key. It is possible to save the file UTF-8 but without BOM. In vim for instance

    :set nobomb
    

    See vim wiki

提交回复
热议问题