adding support for non utf-8 chars