Cross-Python-version unicode helper classes, from EJTP.