handling unicode characters

from commit e9d059d