UTF-8 validation in CLI
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Canonical Juju |
Triaged
|
Wishlist
|
Unassigned |
Bug Description
`juju config` employs UTF-8 validation on provided values, which was added in
https:/
I believe the original reason for this was as follows. `juju config` supports reading configuration values from a file using an `@`. For example,
```
$ juju config <email address hidden>
```
will set the value for `key1` to the contents of `foo.txt`. In this case, it makes sense to check that the contents of `foo.txt` are valid UTF-8 before you set `key1`.
None of the other config commands use UTF-8 validation, and it seems to be used only sporadically throughout the CLI. Commands vary in whether they accept invalid UTF-8 sequences - some just accept it:
```
$ juju model-config ftp-proxy=$(printf %b '\xc3\x28')
$
```
```
$ juju deploy $(printf %b '\xc3\x28')
ERROR no charm was found at "\xc3("
```
```
$ juju bootstrap lxd $(printf %b '\xc3\x28')
Creating Juju controller "�(" on lxd/localhost
...
```
while some will complain:
```
$ juju config hello-juju port=$(printf %b '\xc3\x28')
ERROR value for option "port" contains non-UTF-8 sequences
```
```
$ juju add-model $(printf %b '\xc3\x28')
ERROR "\xc3(" is not a valid name: ...
```
It's worth thinking about whether this should be done more consistently:
- Do we even need UTF-8 validation at all in `config`, `add-model`, etc?
- Should we do this consistently across all the config commands, or even all commands?
i.e. when is UTF-8 validation appropriate/
Changed in juju: | |
status: | New → Incomplete |
status: | Incomplete → Triaged |
Hi, Jordan
That's an interesting issue, and I also think that UTF-8 validation should be done more consistently.
Qq: Will this issue affect negatively the juju client for Windows OSs?