Describe the bug
Erlang string()s in application env are printed by rabbitmqctl environment --formatter=json as lists of bytes rather than as JSON strings.
Reproduction steps
make run-broker
rabbitmqctl environment --formatter=json
Expected behavior
Values like application:get_env(rabbit, cluster_name) should be printed as JSON strings like "cluster_name":"localhost". Currently they are printed as lists of bytes: "cluster_name":[108,111,99,97,108,104,111,115,116]
Additional context
Any binary()s and atom()s are printed as expected, like "anonymous_login_user":"guest".
I'm not sure this can be solved without false-positives but we can try to do as well as EShell and convert lists of UTF-8-looking bytes to binaries.