Fix mixing unicode/utf8 in re.sub