Knuth-Morris-Pratt utf-8 version