various unicode->utf8 bugfixing