ktoml
ktoml copied to clipboard
`@TomlMultiline` does not properly escape backslashes during serialization
Given:
@Serializable
data class Reproducer(
@TomlMultiline
val foo: String
)
val obj = Reproducer("\\\\, \\\"")
val str = Toml.encodeToString(obj)
println(str)
| Expectation | Reality |
|---|---|
|
|
Then, after deserialization,
println(Toml.decodeFromString<Reproducer>(str).foo)
backslashes get "unescaped" and the foo property of the deserialized object is not equal to the original value:
| Expectation | Reality |
|---|---|
|
|