Sophie

Sophie

distrib > Mageia > 6 > x86_64 > media > core-release > by-pkgid > 399492edb08a5eee73f1953c5b5cf636 > files > 295

epydoc-3.0.1-17.mga6.noarch.rpm

<?xml version="1.0" encoding="ascii" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ascii" />
<meta name="generator" content="Docutils 0.5: http://docutils.sourceforge.net/" />
<title>End-to-end Tests for Unicode Encoding</title>
<link rel="stylesheet" href="../custom.css" type="text/css" />
</head>
<body>
<div class="document" id="end-to-end-tests-for-unicode-encoding">
<h1 class="title">End-to-end Tests for Unicode Encoding</h1>

<div class="section" id="test-function">
<h1>Test Function</h1>
<p>The function <cite>testencoding</cite> is used as an end-to-end test for unicode
encodings.  It takes a given string, writes it to a python file, and
processes that file's documentation.  It then generates HTML output
from the documentation, extracts all docstrings from the generated
HTML output, and displays them.  (In order to extract &amp; display all
docstrings, it monkey-patches the HMTLwriter.docstring_to_html()
method.)</p>
<blockquote>
<pre class="py-doctest">
<span class="py-prompt">&gt;&gt;&gt; </span><span class="py-keyword">from</span> epydoc.test.util <span class="py-keyword">import</span> testencoding</pre>
<pre class="py-doctest">
<span class="py-prompt">&gt;&gt;&gt; </span><span class="py-keyword">from</span> epydoc.test.util <span class="py-keyword">import</span> print_warnings
<span class="py-prompt">&gt;&gt;&gt; </span>print_warnings()</pre>
</blockquote>
</div>
<div class="section" id="encoding-tests">
<h1>Encoding Tests</h1>
<p>This section tests the output for a variety of different encodings.
Note that some encodings (such as cp424) are not supported, since
the ascii coding directive would result in a syntax error in the
new encoding.</p>
<p>Tests for several Microsoft codepges:</p>
<blockquote>
<pre class="py-doctest">
<span class="py-prompt">&gt;&gt;&gt; </span>testencoding(<span class="py-string">'''# -*- coding: cp874 -*-</span>
<span class="py-more">... </span><span class="py-string">&quot;&quot;&quot;abc ABC 123 \x80 \x85&quot;&quot;&quot;</span>
<span class="py-more">... </span><span class="py-string">'''</span>)
<span class="py-output">&lt;p&gt;abc ABC 123 &amp;#8364; &amp;#8230;&lt;/p&gt;</span></pre>
<pre class="py-doctest">
<span class="py-prompt">&gt;&gt;&gt; </span>testencoding(<span class="py-string">'''# -*- coding: cp1250 -*-</span>
<span class="py-more">... </span><span class="py-string">&quot;&quot;&quot;abc ABC 123 \x80 \x82 \x84 \x85 \xff&quot;&quot;&quot;</span>
<span class="py-more">... </span><span class="py-string">'''</span>)
<span class="py-output">&lt;p&gt;abc ABC 123 &amp;#8364; &amp;#8218; &amp;#8222; &amp;#8230; &amp;#729;&lt;/p&gt;</span></pre>
<pre class="py-doctest">
<span class="py-prompt">&gt;&gt;&gt; </span>testencoding(<span class="py-string">'''# -*- coding: cp1251 -*-</span>
<span class="py-more">... </span><span class="py-string">&quot;&quot;&quot;abc ABC 123 \x80 \x81 \x82 \xff&quot;&quot;&quot;</span>
<span class="py-more">... </span><span class="py-string">'''</span>)
<span class="py-output">&lt;p&gt;abc ABC 123 &amp;#1026; &amp;#1027; &amp;#8218; &amp;#1103;&lt;/p&gt;</span></pre>
<pre class="py-doctest">
<span class="py-prompt">&gt;&gt;&gt; </span>testencoding(<span class="py-string">'''# -*- coding: cp1252 -*-</span>
<span class="py-more">... </span><span class="py-string">&quot;&quot;&quot;abc ABC 123 \x80 \x82 \x83 \xff&quot;&quot;&quot;</span>
<span class="py-more">... </span><span class="py-string">'''</span>)
<span class="py-output">&lt;p&gt;abc ABC 123 &amp;#8364; &amp;#8218; &amp;#402; &amp;#255;&lt;/p&gt;</span></pre>
<pre class="py-doctest">
<span class="py-prompt">&gt;&gt;&gt; </span>testencoding(<span class="py-string">'''# -*- coding: cp1253 -*-</span>
<span class="py-more">... </span><span class="py-string">&quot;&quot;&quot;abc ABC 123 \x80 \x82 \x83 \xfe&quot;&quot;&quot;</span>
<span class="py-more">... </span><span class="py-string">'''</span>)
<span class="py-output">&lt;p&gt;abc ABC 123 &amp;#8364; &amp;#8218; &amp;#402; &amp;#974;&lt;/p&gt;</span></pre>
</blockquote>
<p>Unicode tests:</p>
<blockquote>
<pre class="py-doctest">
<span class="py-prompt">&gt;&gt;&gt; </span>utf8_test =<span class="py-string">'''\</span>
<span class="py-more">... </span><span class="py-string">&quot;&quot;&quot;abc ABC 123</span>
<span class="py-more">...</span>
<span class="py-more">... </span><span class="py-string">0x80-0x7ff range:</span>
<span class="py-more">... </span><span class="py-string">\xc2\x80 \xc2\x81 \xdf\xbe \xdf\xbf</span>
<span class="py-more">...</span>
<span class="py-more">... </span><span class="py-string">0x800-0xffff range:</span>
<span class="py-more">... </span><span class="py-string">\xe0\xa0\x80 \xe0\xa0\x81 \xef\xbf\xbe \xef\xbf\xbf</span>
<span class="py-more">...</span>
<span class="py-more">... </span><span class="py-string">0x10000-0x10ffff range:</span>
<span class="py-more">... </span><span class="py-string">\xf0\x90\x80\x80 \xf0\x90\x80\x81</span>
<span class="py-more">... </span><span class="py-string">\xf4\x8f\xbf\xbe \xf4\x8f\xbf\xbf</span>
<span class="py-more">... </span><span class="py-string">&quot;&quot;&quot;\n'''</span>
<span class="py-prompt">&gt;&gt;&gt; </span>utf8_bom = <span class="py-string">'\xef\xbb\xbf'</span></pre>
<pre class="py-doctest">
<span class="py-prompt">&gt;&gt;&gt; </span><span class="py-comment"># UTF-8 with a coding directive:</span>
<span class="py-prompt">&gt;&gt;&gt; </span>testencoding(<span class="py-string">&quot;# -*- coding: utf-8 -*-\n&quot;</span>+utf8_test)
<span class="py-output">&lt;p&gt;abc ABC 123&lt;/p&gt;</span>
<span class="py-output">&lt;p&gt;0x80-0x7ff range: &amp;#128; &amp;#129; &amp;#2046; &amp;#2047;&lt;/p&gt;</span>
<span class="py-output">&lt;p&gt;0x800-0xffff range: &amp;#2048; &amp;#2049; &amp;#65534; &amp;#65535;&lt;/p&gt;</span>
<span class="py-output">&lt;p&gt;0x10000-0x10ffff range: &amp;#65536; &amp;#65537; &amp;#1114110; &amp;#1114111;&lt;/p&gt;</span></pre>
<pre class="py-doctest">
<span class="py-prompt">&gt;&gt;&gt; </span><span class="py-comment"># UTF-8 with a BOM &amp; a coding directive:</span>
<span class="py-prompt">&gt;&gt;&gt; </span>testencoding(utf8_bom+<span class="py-string">&quot;# -*- coding: utf-8 -*-\n&quot;</span>+utf8_test)
<span class="py-output">&lt;p&gt;abc ABC 123&lt;/p&gt;</span>
<span class="py-output">&lt;p&gt;0x80-0x7ff range: &amp;#128; &amp;#129; &amp;#2046; &amp;#2047;&lt;/p&gt;</span>
<span class="py-output">&lt;p&gt;0x800-0xffff range: &amp;#2048; &amp;#2049; &amp;#65534; &amp;#65535;&lt;/p&gt;</span>
<span class="py-output">&lt;p&gt;0x10000-0x10ffff range: &amp;#65536; &amp;#65537; &amp;#1114110; &amp;#1114111;&lt;/p&gt;</span></pre>
<pre class="py-doctest">
<span class="py-prompt">&gt;&gt;&gt; </span><span class="py-comment"># UTF-8 with a BOM &amp; no coding directive:</span>
<span class="py-prompt">&gt;&gt;&gt; </span>testencoding(utf8_bom+utf8_test)
<span class="py-output">&lt;p&gt;abc ABC 123&lt;/p&gt;</span>
<span class="py-output">&lt;p&gt;0x80-0x7ff range: &amp;#128; &amp;#129; &amp;#2046; &amp;#2047;&lt;/p&gt;</span>
<span class="py-output">&lt;p&gt;0x800-0xffff range: &amp;#2048; &amp;#2049; &amp;#65534; &amp;#65535;&lt;/p&gt;</span>
<span class="py-output">&lt;p&gt;0x10000-0x10ffff range: &amp;#65536; &amp;#65537; &amp;#1114110; &amp;#1114111;&lt;/p&gt;</span></pre>
</blockquote>
<p>Tests for KOI8-R:</p>
<blockquote>
<pre class="py-doctest">
<span class="py-prompt">&gt;&gt;&gt; </span>testencoding(<span class="py-string">'''# -*- coding: koi8-r -*-</span>
<span class="py-more">... </span><span class="py-string">&quot;&quot;&quot;abc ABC 123 \x80 \x82 \x83 \xff&quot;&quot;&quot;</span>
<span class="py-more">... </span><span class="py-string">'''</span>)
<span class="py-output">&lt;p&gt;abc ABC 123 &amp;#9472; &amp;#9484; &amp;#9488; &amp;#1066;&lt;/p&gt;</span></pre>
</blockquote>
<p>Tests for 'coding' directive on the second line:</p>
<blockquote>
<pre class="py-doctest">
<span class="py-prompt">&gt;&gt;&gt; </span>testencoding(<span class="py-string">'''\n# -*- coding: cp1252 -*-</span>
<span class="py-more">... </span><span class="py-string">&quot;&quot;&quot;abc ABC 123 \x80 \x82 \x83 \xff&quot;&quot;&quot;</span>
<span class="py-more">... </span><span class="py-string">'''</span>)
<span class="py-output">&lt;p&gt;abc ABC 123 &amp;#8364; &amp;#8218; &amp;#402; &amp;#255;&lt;/p&gt;</span></pre>
<pre class="py-doctest">
<span class="py-prompt">&gt;&gt;&gt; </span>testencoding(<span class="py-string">'''# comment on the first line.\n# -*- coding: cp1252 -*-</span>
<span class="py-more">... </span><span class="py-string">&quot;&quot;&quot;abc ABC 123 \x80 \x82 \x83 \xff&quot;&quot;&quot;</span>
<span class="py-more">... </span><span class="py-string">'''</span>)
<span class="py-output">&lt;p&gt;abc ABC 123 &amp;#8364; &amp;#8218; &amp;#402; &amp;#255;&lt;/p&gt;</span></pre>
<pre class="py-doctest">
<span class="py-prompt">&gt;&gt;&gt; </span>testencoding(<span class="py-string">&quot;\n# -*- coding: utf-8 -*-\n&quot;</span>+utf8_test)
<span class="py-output">&lt;p&gt;abc ABC 123&lt;/p&gt;</span>
<span class="py-output">&lt;p&gt;0x80-0x7ff range: &amp;#128; &amp;#129; &amp;#2046; &amp;#2047;&lt;/p&gt;</span>
<span class="py-output">&lt;p&gt;0x800-0xffff range: &amp;#2048; &amp;#2049; &amp;#65534; &amp;#65535;&lt;/p&gt;</span>
<span class="py-output">&lt;p&gt;0x10000-0x10ffff range: &amp;#65536; &amp;#65537; &amp;#1114110; &amp;#1114111;&lt;/p&gt;</span></pre>
<pre class="py-doctest">
<span class="py-prompt">&gt;&gt;&gt; </span>testencoding(<span class="py-string">&quot;# comment\n# -*- coding: utf-8 -*-\n&quot;</span>+utf8_test)
<span class="py-output">&lt;p&gt;abc ABC 123&lt;/p&gt;</span>
<span class="py-output">&lt;p&gt;0x80-0x7ff range: &amp;#128; &amp;#129; &amp;#2046; &amp;#2047;&lt;/p&gt;</span>
<span class="py-output">&lt;p&gt;0x800-0xffff range: &amp;#2048; &amp;#2049; &amp;#65534; &amp;#65535;&lt;/p&gt;</span>
<span class="py-output">&lt;p&gt;0x10000-0x10ffff range: &amp;#65536; &amp;#65537; &amp;#1114110; &amp;#1114111;&lt;/p&gt;</span></pre>
</blockquote>
<p>Tests for shift-jis</p>
<blockquote>
<pre class="py-doctest">
<span class="py-prompt">&gt;&gt;&gt; </span>testencoding(<span class="py-string">'''# -*- coding: shift_jis -*-</span>
<span class="py-more">... </span><span class="py-string">&quot;&quot;&quot;abc ABC 123 \xA1 \xA2 \xA3&quot;&quot;&quot;</span>
<span class="py-more">... </span><span class="py-string">'''</span>) <span class="py-comment"># doctest: +PYTHON2.4</span>
<span class="py-output">abc ABC 123 &amp;#65377; &amp;#65378; &amp;#65379;</span></pre>
</blockquote>
</div>
<div class="section" id="str-unicode-test">
<h1>Str/Unicode Test</h1>
<p>Make sure that we use the coding for both str and unicode docstrings.</p>
<blockquote>
<pre class="py-doctest">
<span class="py-prompt">&gt;&gt;&gt; </span>testencoding(<span class="py-string">'''# -*- coding: utf-8 -*-</span>
<span class="py-more">... </span><span class="py-string">&quot;&quot;&quot;abc ABC 123 \xc2\x80 \xdf\xbf \xe0\xa0\x80&quot;&quot;&quot;</span>
<span class="py-more">... </span><span class="py-string">'''</span>)
<span class="py-output">&lt;p&gt;abc ABC 123 &amp;#128; &amp;#2047; &amp;#2048;&lt;/p&gt;</span></pre>
<pre class="py-doctest">
<span class="py-prompt">&gt;&gt;&gt; </span>testencoding(<span class="py-string">'''# -*- coding: utf-8 -*-</span>
<span class="py-more">... </span><span class="py-string">u&quot;&quot;&quot;abc ABC 123 \xc2\x80 \xdf\xbf \xe0\xa0\x80&quot;&quot;&quot;</span>
<span class="py-more">... </span><span class="py-string">'''</span>)
<span class="py-output">&lt;p&gt;abc ABC 123 &amp;#128; &amp;#2047; &amp;#2048;&lt;/p&gt;</span></pre>
</blockquote>
<p>Under special circumstances, we may not be able to tell what the
proper encoding for a docstring is.  This happens if:</p>
<ol class="arabic simple">
<li>the docstring is only available via introspection.</li>
<li>we are unable to determine what module the object that owns
the docstring came from.</li>
<li>the docstring contains non-ascii characters</li>
</ol>
<p>Under these circumstances, we issue a warning, and treat the docstring
as latin-1.  An example of this is a non-unicode docstring for
properties:</p>
<blockquote>
<pre class="py-doctest">
<span class="py-prompt">&gt;&gt;&gt; </span>testencoding(<span class="py-string">'''# -*- coding: utf-8 -*-</span>
<span class="py-more">... </span><span class="py-string">p=property(doc=&quot;&quot;&quot;\xc2\x80&quot;&quot;&quot;)</span>
<span class="py-more">... </span><span class="py-string">'''</span>) <span class="py-comment"># doctest: +ELLIPSIS</span>
<span class="py-output">&lt;property object at ...&gt;'s docstring is not a unicode string, but it contains non-ascii data -- treating it as latin-1.</span>
<span class="py-output">&amp;#194;&amp;#128;</span></pre>
</blockquote>
</div>
<div class="section" id="introspection-parsing-tests">
<h1>Introspection/Parsing Tests</h1>
<p>This section checks to make sure that both introspection &amp; parsing are
getting the right results.</p>
<blockquote>
<pre class="py-doctest">
<span class="py-prompt">&gt;&gt;&gt; </span>testencoding(<span class="py-string">&quot;# -*- coding: utf-8 -*-\n&quot;</span>+utf8_test, introspect=False)
<span class="py-output">&lt;p&gt;abc ABC 123&lt;/p&gt;</span>
<span class="py-output">&lt;p&gt;0x80-0x7ff range: &amp;#128; &amp;#129; &amp;#2046; &amp;#2047;&lt;/p&gt;</span>
<span class="py-output">&lt;p&gt;0x800-0xffff range: &amp;#2048; &amp;#2049; &amp;#65534; &amp;#65535;&lt;/p&gt;</span>
<span class="py-output">&lt;p&gt;0x10000-0x10ffff range: &amp;#65536; &amp;#65537; &amp;#1114110; &amp;#1114111;&lt;/p&gt;</span>
<span class="py-output"></span><span class="py-prompt">&gt;&gt;&gt; </span>testencoding(utf8_bom+<span class="py-string">&quot;# -*- coding: utf-8 -*-\n&quot;</span>+utf8_test, introspect=False)
<span class="py-output">&lt;p&gt;abc ABC 123&lt;/p&gt;</span>
<span class="py-output">&lt;p&gt;0x80-0x7ff range: &amp;#128; &amp;#129; &amp;#2046; &amp;#2047;&lt;/p&gt;</span>
<span class="py-output">&lt;p&gt;0x800-0xffff range: &amp;#2048; &amp;#2049; &amp;#65534; &amp;#65535;&lt;/p&gt;</span>
<span class="py-output">&lt;p&gt;0x10000-0x10ffff range: &amp;#65536; &amp;#65537; &amp;#1114110; &amp;#1114111;&lt;/p&gt;</span>
<span class="py-output"></span><span class="py-prompt">&gt;&gt;&gt; </span>testencoding(utf8_bom+utf8_test, introspect=False)
<span class="py-output">&lt;p&gt;abc ABC 123&lt;/p&gt;</span>
<span class="py-output">&lt;p&gt;0x80-0x7ff range: &amp;#128; &amp;#129; &amp;#2046; &amp;#2047;&lt;/p&gt;</span>
<span class="py-output">&lt;p&gt;0x800-0xffff range: &amp;#2048; &amp;#2049; &amp;#65534; &amp;#65535;&lt;/p&gt;</span>
<span class="py-output">&lt;p&gt;0x10000-0x10ffff range: &amp;#65536; &amp;#65537; &amp;#1114110; &amp;#1114111;&lt;/p&gt;</span></pre>
<pre class="py-doctest">
<span class="py-prompt">&gt;&gt;&gt; </span>testencoding(<span class="py-string">&quot;# -*- coding: utf-8 -*-\n&quot;</span>+utf8_test, parse=False)
<span class="py-output">&lt;p&gt;abc ABC 123&lt;/p&gt;</span>
<span class="py-output">&lt;p&gt;0x80-0x7ff range: &amp;#128; &amp;#129; &amp;#2046; &amp;#2047;&lt;/p&gt;</span>
<span class="py-output">&lt;p&gt;0x800-0xffff range: &amp;#2048; &amp;#2049; &amp;#65534; &amp;#65535;&lt;/p&gt;</span>
<span class="py-output">&lt;p&gt;0x10000-0x10ffff range: &amp;#65536; &amp;#65537; &amp;#1114110; &amp;#1114111;&lt;/p&gt;</span>
<span class="py-output"></span><span class="py-prompt">&gt;&gt;&gt; </span>testencoding(utf8_bom+<span class="py-string">&quot;# -*- coding: utf-8 -*-\n&quot;</span>+utf8_test, parse=False)
<span class="py-output">&lt;p&gt;abc ABC 123&lt;/p&gt;</span>
<span class="py-output">&lt;p&gt;0x80-0x7ff range: &amp;#128; &amp;#129; &amp;#2046; &amp;#2047;&lt;/p&gt;</span>
<span class="py-output">&lt;p&gt;0x800-0xffff range: &amp;#2048; &amp;#2049; &amp;#65534; &amp;#65535;&lt;/p&gt;</span>
<span class="py-output">&lt;p&gt;0x10000-0x10ffff range: &amp;#65536; &amp;#65537; &amp;#1114110; &amp;#1114111;&lt;/p&gt;</span>
<span class="py-output"></span><span class="py-prompt">&gt;&gt;&gt; </span>testencoding(utf8_bom+utf8_test, parse=False)
<span class="py-output">&lt;p&gt;abc ABC 123&lt;/p&gt;</span>
<span class="py-output">&lt;p&gt;0x80-0x7ff range: &amp;#128; &amp;#129; &amp;#2046; &amp;#2047;&lt;/p&gt;</span>
<span class="py-output">&lt;p&gt;0x800-0xffff range: &amp;#2048; &amp;#2049; &amp;#65534; &amp;#65535;&lt;/p&gt;</span>
<span class="py-output">&lt;p&gt;0x10000-0x10ffff range: &amp;#65536; &amp;#65537; &amp;#1114110; &amp;#1114111;&lt;/p&gt;</span></pre>
</blockquote>
</div>
<div class="section" id="context-checks">
<h1>Context checks</h1>
<p>Make sure that docstrings are rendered correctly in different contexts.</p>
<blockquote>
<pre class="py-doctest">
<span class="py-prompt">&gt;&gt;&gt; </span>testencoding(<span class="py-string">'''# -*- coding: utf-8 -*-</span>
<span class="py-more">... </span><span class="py-string">&quot;&quot;&quot;</span>
<span class="py-more">... </span><span class="py-string">@var x: abc ABC 123 \xc2\x80 \xdf\xbf \xe0\xa0\x80</span>
<span class="py-more">... </span><span class="py-string">@group \xc2\x80: x</span>
<span class="py-more">... </span><span class="py-string">&quot;&quot;&quot;</span>
<span class="py-more">... </span><span class="py-string">'''</span>)
<span class="py-output">abc ABC 123 &amp;#128; &amp;#2047; &amp;#2048;</span></pre>
<pre class="py-doctest">
<span class="py-prompt">&gt;&gt;&gt; </span>testencoding(<span class="py-string">'''# -*- coding: utf-8 -*-</span>
<span class="py-more">... </span><span class="py-string">def f(x):</span>
<span class="py-more">... </span><span class="py-string">    &quot;&quot;&quot;</span>
<span class="py-more">... </span><span class="py-string">    abc ABC 123 \xc2\x80 \xdf\xbf \xe0\xa0\x80</span>
<span class="py-more">... </span><span class="py-string">    @param x: abc ABC 123 \xc2\x80 \xdf\xbf \xe0\xa0\x80</span>
<span class="py-more">... </span><span class="py-string">    @type x: abc ABC 123 \xc2\x80 \xdf\xbf \xe0\xa0\x80</span>
<span class="py-more">... </span><span class="py-string">    @return: abc ABC 123 \xc2\x80 \xdf\xbf \xe0\xa0\x80</span>
<span class="py-more">... </span><span class="py-string">    @rtype: abc ABC 123 \xc2\x80 \xdf\xbf \xe0\xa0\x80</span>
<span class="py-more">... </span><span class="py-string">    @except X: abc ABC 123 \xc2\x80 \xdf\xbf \xe0\xa0\x80</span>
<span class="py-more">... </span><span class="py-string">    &quot;&quot;&quot;</span>
<span class="py-more">... </span><span class="py-string">'''</span>)
<span class="py-output">abc ABC 123 &amp;#128; &amp;#2047; &amp;#2048;</span>
<span class="py-output">abc ABC 123 &amp;#128; &amp;#2047; &amp;#2048;</span>
<span class="py-output">&lt;p&gt;abc ABC 123 &amp;#128; &amp;#2047; &amp;#2048;&lt;/p&gt;</span>
<span class="py-output">abc ABC 123 &amp;#128; &amp;#2047; &amp;#2048;</span>
<span class="py-output">abc ABC 123 &amp;#128; &amp;#2047; &amp;#2048;</span>
<span class="py-output">abc ABC 123 &amp;#128; &amp;#2047; &amp;#2048;</span>
<span class="py-output">abc ABC 123 &amp;#128; &amp;#2047; &amp;#2048;</span>
<span class="py-output">abc ABC 123 &amp;#128; &amp;#2047; &amp;#2048;</span></pre>
<pre class="py-doctest">
<span class="py-prompt">&gt;&gt;&gt; </span>testencoding(<span class="py-string">'''# -*- coding: utf-8 -*-</span>
<span class="py-more">... </span><span class="py-string">class A:</span>
<span class="py-more">... </span><span class="py-string">    &quot;&quot;&quot;</span>
<span class="py-more">... </span><span class="py-string">    abc ABC 123 \xc2\x80 \xdf\xbf \xe0\xa0\x80</span>
<span class="py-more">... </span><span class="py-string">    @ivar x: abc ABC 123 \xc2\x80 \xdf\xbf \xe0\xa0\x80</span>
<span class="py-more">... </span><span class="py-string">    @cvar y: abc ABC 123 \xc2\x80 \xdf\xbf \xe0\xa0\x80</span>
<span class="py-more">... </span><span class="py-string">    @type x: abc ABC 123 \xc2\x80 \xdf\xbf \xe0\xa0\x80</span>
<span class="py-more">... </span><span class="py-string">    &quot;&quot;&quot;</span>
<span class="py-more">...</span>
<span class="py-more">... </span><span class="py-string">    z = property(doc=u&quot;abc ABC 123 \xc2\x80 \xdf\xbf \xe0\xa0\x80&quot;)</span>
<span class="py-more">... </span><span class="py-string">'''</span>)
<span class="py-output">abc ABC 123 &amp;#128; &amp;#2047; &amp;#2048;</span>
<span class="py-output">&lt;p&gt;abc ABC 123 &amp;#128; &amp;#2047; &amp;#2048;&lt;/p&gt;</span>
<span class="py-output">abc ABC 123 &amp;#128; &amp;#2047; &amp;#2048;</span>
<span class="py-output">abc ABC 123 &amp;#128; &amp;#2047; &amp;#2048;</span>
<span class="py-output">abc ABC 123 &amp;#128; &amp;#2047; &amp;#2048;</span>
<span class="py-output">abc ABC 123 &amp;#128; &amp;#2047; &amp;#2048;</span></pre>
</blockquote>
</div>
</div>
<table width="100%" class="navbox" cellpadding="1" cellspacing="0">
  <tr>
  <a class="nav" href="../index.html">
    <td align="center" width="20%" class="nav">
    <a class="nav" href="../index.html">
    Home</a></td></a>
  <a class="nav" href="../installing.html">
    <td align="center" width="20%" class="nav">
    <a class="nav" href="../installing.html">
    Installing Epydoc</a></td></a>
  <a class="nav" href="../using.html">
    <td align="center" width="20%" class="nav">
    <a class="nav" href="../using.html">
    Using Epydoc</a></td></a>
  <a class="nav" href="../epytext.html">
    <td align="center" width="20%" class="nav">
    <a class="nav" href="../epytext.html">
    Epytext</a></td></a>
  <td align="center" width="20%" class="nav">
    
    <A href="http://sourceforge.net/projects/epydoc"> 
    <IMG src="../sflogo.png" 
    width="88" height="26" border="0" alt="SourceForge"
    align="top"/></A></td>
    </tr>
</table>
</body>
</html>