fixed unicode output bug
a better fix for unicode characters