implemented better utf8 support through codecs module