Handle non-utf8 ref names