When __repr__ returns an unicode object, python will
try to encode it with the default encoding scheme
which is ascii in general. So __repr__ needs to make
sure its return value is properly encoded.
Change-Id: Ifdb8c073474a917207a48fc5af5a340e87f66fc4
Closes-Bug: #1514325