handles non-ascii chars