add non-ascii tests - improve to_unicode function

The hardcoded utf8 isn't really nice but that was already the case...
fixes for to_unicode