Use case
INI files sometimes escape dots in section names using backslash:
[Section\.1]
name = value
In current SharpConfig, the section name remains "Section\.1" (with the backslash). I'd like it to be interpreted as "Section.1" for lookups and to escape automatically when saving.
Proposal
- Add a new option like:
var options = new ConfigurationOptions {
UnescapeSectionNames = true
};
var cfg = Configuration.LoadFromFile(path, options);
- Parse: convert
"\." → "."
- Serialize: convert
"." → "\." in section headers
- Add test cases to verify behavior
Benefits
- Easier to write natural lookups:
var sec = cfg["Section.1"]; // works as expected
Let me know what you think or if there's an existing branch for this feature!
Use case
INI files sometimes escape dots in section names using backslash:
In current SharpConfig, the section name remains
"Section\.1"(with the backslash). I'd like it to be interpreted as"Section.1"for lookups and to escape automatically when saving.Proposal
"\."→".""."→"\."in section headersBenefits
Let me know what you think or if there's an existing branch for this feature!