"""
if six.PY2 and isinstance(word, unicode):
return s.encode(encoding)
elif six.PY3 and isinstance(word, str):
return s.encode(encoding) // bytes must be in utf8
return s.decode(encoding).encode(encoding)
After Change
"""Convert the string to binary"""
if isinstance(s, six.text_type):
return s.encode(encoding)
elif isinstance(s, six.binary_type):
// make sure the binary is in required encoding
return s.decode(encoding).encode(encoding)
else: