py2.6 str.encode() does not accept keyword argument.