jnbt / java-properties

Loader and writer for *.properties files
MIT License
42 stars 22 forks source link

Escaped characters don't get properly unescaped #16

Open nostradani opened 3 years ago

nostradani commented 3 years ago

When java writes a properties file, the following characters get escaped: =:!#

{ "Caution" => "=:!#" } will be written by Java as Caution=\=\:\!\#

In general, Java seems to simply omit single backslashes when parsing a properties file Example: "Invalid=x\x" will be read as {"Invalid" => "xx" }

However this gem doesn't respect that. When reading the first properties file, it will become {"Caution" => "\=\:\!\#" } Writing that again, it will become Caution=\\=\\:\\!\\#