Small fix for python2 unicode handling

Fixed error in python 2 when unicode characters were in pages.