fix unicode (8 bit) issues. fixes #354