If you go with my suggestion of encoding the pair string later on then you could avoid implicit encoding here by doing ``u''.join(map(...))``