Error messages from `check_permission` can be utf-8, so use `unicode` module instead of `list_to_binary`.