parameters: (pkg_info, field)
return_statement: return text
docstring: Hack to coax Unicode out of an email Message() - Python 3.3+
docstring_summary: Hack to coax Unicode out of an email Message() - Python 3.3+
docstring_tokens: Hack to coax Unicode out of an email Message () - Python 3 . 3 +
function: def pkginfo_unicode(pkg_info, field):
      """Hack to coax Unicode out of an email Message() - Python 3.3+"""
      text = pkg_info[field]
      field = field.lower()
      if not isinstance(text, str):
          for item in pkg_info.raw_items():
              if item[0].lower() == field:
                  text = item[1].encode('ascii', 'surrogateescape') \
                      .decode('utf-8')
                  break
  
      return text
function_tokens: def pkginfo_unicode ( pkg_info , field ) : text = pkg_info [ field ] field = field . lower ( ) if not isinstance ( text , str ) : for item in pkg_info . raw_items ( ) : if item [ 0 ] . lower ( ) == field : text = item [ 1 ] . encode ( 'ascii' , 'surrogateescape' ) . decode ( 'utf-8' ) break return text