'test the html_error_template with a Template containing utf8
chars'

@requires_pygments_14
def test_utf8_html_error_template_pygments(self):

    if compat.py3k:
        code = "#    -*-    coding:    utf-8    -*-\n%    if    2    ==    2:    /an    error\n${'\xd0\xbf\xd1\x80\xd0\xb8\xd0\xb2\xd0\xb5\xd1\x82'}\n%    endif\n"
    else:
        code = "#    -*-    coding:    utf-8    -*-\n%    if    2    ==    2:    /an    error\n${u'\xd0\xbf\xd1\x80\xd0\xb8\xd0\xb2\xd0\xb5\xd1\x82'}\n%    endif\n"
    try:
        template = Template(code)
        template.render_unicode()
    except exceptions.CompileException:
        html_error = exceptions.html_error_template().render()
        if compat.py3k:
            assert ('CompileException:    Fragment    &#39;if    2    ==    2:    /an    error&#39;    is    not    a    partial    control    statement    at    line:    2    char:    1'.encode(sys.getdefaultencoding(), 'htmlentityreplace') in html_error)
        else:
            assert ('CompileException:    Fragment    &#39;if    2    ==    2:    /an    error&#39;    is    not    a    partial    control    statement    at    line:    2    char:    1' in html_error)
        if compat.py3k:
            assert (''.encode(sys.getdefaultencoding(), 'htmlentityreplace') in html_error)
        else:
            assert ('<pre>3</pre></div></td><td    class="code"><div    class="syntax-highlighted"><pre><span    class="cp">${</span><span    class="s">u&#39;&#x43F;&#x440;&#x438;&#x432;&#x435;&#x442;&#39;</span><span    class="cp">}</span>'.encode(sys.getdefaultencoding(), 'htmlentityreplace') in html_error)
    else:
        assert False, "This    function    should    trigger    a    CompileException,    but    didn't"
