def NotUnicode(string):
 if isinstance(string, unicode):
  string = string.encode('utf-8')
 if (not isinstance(string, str)):
  return str(string)
 return string

def NotUnicode ( string ) : if isinstance ( string , unicode ) : string = string . encode ( 'utf-8' ) if ( not isinstance ( string , str ) ) : return str ( string ) return string
make sure a string is not unicode .