code: def UTF8ToUTF16BE(instr, setbom=True):
      "Converts UTF-8 strings to UTF16-BE."
      outstr = "".encode()
      if (setbom):
          outstr += "\xFE\xFF".encode("latin1")
      if not isinstance(instr, unicode):
          instr = instr.decode('UTF-8')
      outstr += instr.encode('UTF-16BE')
      # convert bytes back to fake unicode string until PEP461-like is implemented
      if PY3K:
          outstr = outstr.decode("latin1")
      return outstf UTF8ToUTF16BE(instr, setbom=True):
      "Converts UTF-8 strings to UTF16-BE."
      outstr = "".encode()
      if (setbom):
          outstr += "\xFE\xFF".encode("latin1")
      if not isinstance(instr, unicode):
          instr = instr.decode('UTF-8')
      outstr += instr.encode('UTF-16BE')
      # convert bytes back to fake unicode string until PEP461-like is implemented
      if PY3K:
          outstr = outstr.decode("latin1")
      return outstr
docs: Converts UTF-8 strings to UTF16-BE.