I wonder if it would be cleaner to simply ensure that all strings in attributes are unicode in the backends instead of doing it here?