sh: Add UTF-8 support to pattern matching.
?, [...] patterns match codepoints instead of bytes. They do not match
invalid sequences. [...] patterns must not contain invalid sequences
otherwise they will not match anything. This is so that ${var#?} removes
the first codepoint, not the first byte, without putting UTF-8 knowledge
into the ${var#pattern} code. However, * continues to match any string
and an invalid sequence matches an identical invalid sequence. (This
differs from fnmatch(3).)
Obtained-from: FreeBSD SVN rev 221646 & 223010