Fix repr unicode handling

Python2 requires utf-8 encoded bytestring
Python3 requires unicode string