human
Complete the below
def makeCgiPrintEncoding(encoding):

    ''''Make a function to pretty-print strings for the web.'
    '''

What is a Python code to print strings for the web?
assistant
#Here is Python code to print strings for the web.
    def cgiPrint(s):
        ('Encode    the    given    string    using    the    %s    encoding,    and    replace\n                                chars    outside    the    given    charset    with    XML    char    references.' % encoding)
        s = escape(s, quote=1)
        if isinstance(s, unicode):
            s = s.encode(encoding, 'xmlcharrefreplace')
        return s
    return cgiPrint