Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Configs with backslashes don't survive round-trip serialization. #350

Open
ClaytonHughes opened this issue Oct 13, 2021 · 0 comments
Open

Comments

@ClaytonHughes
Copy link
Contributor

Version Information
From Nuget: Hocon and Hocon.Configuration 2.0.3

(Reproduced on dev, (482a9c1), with failing tests, here: ClaytonHughes@0e55a7c)

Describe the bug
When configurations are serialized, backslashes are not escaped. This means a round-trip serialization of a Config will not succeed.

To Reproduce
Steps to reproduce the behavior:

  1. Have a backslash in your Config (e.g. by parsing a string with an escaped backslash)
  2. Serialize it - note the output is incorrect (backslashes are not escaped)
  3. Parse the serialization - note the tokenizer exception because of the invalid input

Expected behavior
Configurations serialize into valid Json/HOCON (backslashes are escaped).

Actual behavior
Configurations do not escape backslashes, producing (likely) invalid Json/Hocon.

Environment
net461, netcoreapp2.1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant