properties icon indicating copy to clipboard operation
properties copied to clipboard

Equal sign is incorrectly escaped in key

Open nicolaferraro opened this issue 3 years ago • 0 comments

I'm doing the following test:

// Set a key to "a=b" and value "c"
p := properties.NewProperties()
p.Set("a=b", "c")
buf := new(bytes.Buffer)
p.Write(buf, properties.UTF8)
println(buf.String())

I'd espect the serialized version to be:

a\=b = c

Since the \ should be used to escape the first equal sign, but the program prints:

a=b = c

Which seems wrong. If saved in a file and read again, the key becomes "a" (while, when reading from the correct file, the key is correctly interpreted as "a=b").

nicolaferraro avatar Jun 07 '21 11:06 nicolaferraro