What happens if a string that is not utf-8 but is also invalid? I doubt very much that we need exceptional handling for utf-8 here.

What happens if a string pattern is supplied that has an invalid encoding?