Unicode fixes for python 2.x

These changes have been tested with Python 3.2.3 and Python 2.7.5.
Merge pull request #506 from kytvi2p/unicode2.x

Unicode fixes for python 2.x