def _unicode_to_mbcs(instr):
 if isinstance(instr, six.text_type):
  return instr.encode(u'mbcs')
 else:
  return instr

def _unicode_to_mbcs ( instr ) : if isinstance ( instr , six . text_type ) : return instr . encode ( u'mbcs' ) else : return instr
converts unicode to to current users character encoding .