Make utilities.encoding.get_unicode more robust

This somewhat fixes #166