added encoding detection and support for UTF-8 strings