Skip to content
This repository has been archived by the owner on Sep 14, 2023. It is now read-only.

Support decoding into OsStrings #152

Open
BlacklightShining opened this issue Nov 28, 2015 · 2 comments
Open

Support decoding into OsStrings #152

BlacklightShining opened this issue Nov 28, 2015 · 2 comments

Comments

@BlacklightShining
Copy link

From what I can tell, docopt only supports parsing arguments into Rust strings. This means that if a program uses docopt, it won't be able to take any arguments that aren't valid UTF-8, even if they may be otherwise perfectly valid (e.g. a path to a file on a *nix system).

@BlacklightShining
Copy link
Author

Related to #135, I think: the ability to take paths as OsStrings would probably solve that, while avoiding ambiguity in interpreting whether a Vec<u8> is a u8 option that can be passed multiple times, or a not-necessarily-valid-UTF-8 string.

@BurntSushi
Copy link
Member

You are absolutely correct. I was not particularly principled with this when building docopt, so it is quite possible that this could require some refactoring.

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

No branches or pull requests

2 participants