Close #22882. Fixed `UnicodeDecodeError`s in commands.

Don't you want `force_str` here?