sh: Add UTF-8 support to pattern matching.