Fixed unicode handling for Python 3.

Hi,

Python 3 does not have unicode() function.
So changed using str() instead of unicode() when Python3.

Best regards,

Signed-off-by: Kouhei Maeda <mkouhei@palmtb.net>