Added supporting of UTF-16 encoding.