java-properties icon indicating copy to clipboard operation
java-properties copied to clipboard

Escaped characters don't get properly unescaped

Open nostradani opened this issue 5 years ago • 0 comments

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=\\=\\:\\!\\#

nostradani avatar Nov 26 '20 14:11 nostradani