utf8.c: add reencode_string_len() that can handle NULs in string