Add encoding for python2.