filipegoncalves / rust-config

Configuration file library in Rust similar to C/C++'s libconfig
MIT License
20 stars 10 forks source link

filesystem paths in config files #10

Open sp3d opened 9 years ago

sp3d commented 9 years ago

Config files are assumed to be UTF-8, but filesystem paths might be in a different encoding, e.g. UCS-2 for Windows. It would be nice if filesystem paths could be included in config files without assuming that all file paths can be represented as sequences of Unicode codepoints; e.g. on Windows, this assumption is untrue: https://simonsapin.github.io/wtf-8/#motivation

It would be easiest if there were an OsStr-typed scalar value.

filipegoncalves commented 9 years ago

That's a good point. I think your idea is reasonable - create an OsStr scalar type that is backed by a Rust Path in the library.

Will look into this soon, or if you'd like feel free to submit a PR - whatever suits you best.