def getPDFstr(s):
if not bool(s):<EOL><INDENT>return "<STR_LIT>"<EOL><DEDENT>def make_utf16be(s):<EOL><INDENT>r = hexlify(bytearray([<NUM_LIT>, <NUM_LIT:255>]) + bytearray(s, "<STR_LIT>"))<EOL>t = r if fitz_py2 else r.decode()<EOL>return "<STR_LIT:<>" + t + "<STR_LIT:>>"                         <EOL><DEDENT>llowing either returns original string with mixed-in <EOL>tal numbers\nnn if outside ASCII range, or:<EOL>its with utf-<NUM_LIT:16>be BOM version of the string<EOL>r = "<STR_LIT>"<EOL>for c in s:<EOL><INDENT>oc = ord(c)<EOL>if oc > <NUM_LIT:255>:                                  <EOL><INDENT>return make_utf16be(s)<EOL><DEDENT>if oc > <NUM_LIT> and oc < <NUM_LIT>:<EOL><INDENT>if c in ("<STR_LIT:(>", "<STR_LIT:)>", "<STR_LIT:\\>"):<EOL><INDENT>r += "<STR_LIT:\\>"<EOL><DEDENT>r += c<EOL>continue<EOL><DEDENT>if oc > <NUM_LIT>:<EOL><INDENT>r += "<STR_LIT:\\>" + oct(oc)[-<NUM_LIT:3>:]<EOL>continue<EOL><DEDENT>if oc < <NUM_LIT:8> or oc > <NUM_LIT> or oc == <NUM_LIT:11> or c == <NUM_LIT>:<EOL><INDENT>r += "<STR_LIT>"   <EOL>continue<EOL><DEDENT>if oc == <NUM_LIT:8>:<EOL><INDENT>r += "<STR_LIT>"<EOL><DEDENT>elif oc == <NUM_LIT:9>:<EOL><INDENT>r += "<STR_LIT>"<EOL><DEDENT>elif oc == <NUM_LIT:10>:<EOL><INDENT>r += "<STR_LIT>"<EOL><DEDENT>elif oc == <NUM_LIT:12>:<EOL><INDENT>r += "<STR_LIT>"<EOL><DEDENT>elif oc == <NUM_LIT>:<EOL><INDENT>r += "<STR_LIT>"<EOL><DEDENT><DEDENT>return "<STR_LIT:(>" + r + "<STR_LIT:)>"<EOL>
Return a PDF string depending on its coding.

    Notes:
        If only ascii then "(original)" is returned, else if only 8 bit chars
        then "(original)" with interspersed octal strings \nnn is returned,
        else a string "<FEFF[hexstring]>" is returned, where [hexstring] is the
        UTF-16BE encoding of the original.