repo_autopattern: make sure that the category is valid utf8