conversion to utf8 encoded bytestring before regex