Open traetox opened 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.
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).
non-constant strings should allow for things like
\xFF\xEF
and\uFFEF