Works with UTF-8 text and multi-language input.