patch and tests for handling of unicode strings - requires unicode=1 flag