def UTF8ToUTF16BE(instr, setbom=True):
outstr = "<STR_LIT>".encode()<EOL>if (setbom):<EOL><INDENT>outstr += "<STR_LIT>".encode("<STR_LIT>")<EOL><DEDENT>if not isinstance(instr, unicode):<EOL><INDENT>instr = instr.decode('<STR_LIT>')<EOL><DEDENT>outstr += instr.encode('<STR_LIT>')<EOL>if PY3K:<EOL><INDENT>outstr = outstr.decode("<STR_LIT>")<EOL><DEDENT>return outstr<EOL>
Converts UTF-8 strings to UTF16-BE.