gravwell / gcfg

read INI-style configuration files into Go structs; supports user-defined types and subsections
https://gopkg.in/gcfg.v1
Other
0 stars 4 forks source link

allow escaped unicode and binary sequences #9

Open traetox opened 2 years ago

traetox commented 2 years ago

non-constant strings should allow for things like \xFF\xEF and \uFFEF

david-fritz-gravwell commented 2 years ago

go/scanner has an implementation for this but it's deeply integrated towards go source. I ported this for internal use in a convenience function that we could promote to a gravwell/gravwell utility function and use. That's probably a good idea overall, as there are many places we want to normalize string unescaping rules.

david-fritz-gravwell commented 1 year ago

https://github.com/gravwell/gcfg/compare/v1...david-fritz-gravwell:gcfg:v1

Has the necessary logic, but it feels weird to only unescape unicode/binary, and not things like newlines, etc (which we have existing tests for).