correctly dealing with unicode chars