Skip to content

Commit

Permalink
Python 3 'surrogateescape' docs: fix div class for Python code
Browse files Browse the repository at this point in the history
  • Loading branch information
hfalcic committed May 24, 2014
1 parent d1f95ab commit 20ddfb7
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions Doc/Manual/Python.html
Expand Up @@ -5962,8 +5962,8 @@ <H3><a name="Python_nn77"></a>35.12.4 Byte string output conversion</H3>
text string:
</p>

<div class="code"><pre>
&gt;&gt;&gt; s = test.non_utf8_c_str()
<div class="targetlang"><pre>
&gt;&gt;&gt; s = example.non_utf8_c_str()
&gt;&gt;&gt; s
'h\udce9llo w&#246;rld'
</pre></div>
Expand All @@ -5974,7 +5974,7 @@ <H3><a name="Python_nn77"></a>35.12.4 Byte string output conversion</H3>
the original byte sequence:
</p>

<div class="code"><pre>
<div class="targetlang"><pre>
&gt;&gt;&gt; b = s.encode('utf-8', errors='surrogateescape')
&gt;&gt;&gt; b
b'h\xe9llo w\xc3\xb6rld'
Expand All @@ -5985,7 +5985,7 @@ <H3><a name="Python_nn77"></a>35.12.4 Byte string output conversion</H3>
byte string as a raw sequence of bytes for use in binary protocols):
</p>

<div class="code"><pre>
<div class="targetlang"><pre>
&gt;&gt;&gt; b.decode('latin-1')
'h&#233;llo w&#195;&#182;rld'
</pre></div>
Expand All @@ -5995,7 +5995,7 @@ <H3><a name="Python_nn77"></a>35.12.4 Byte string output conversion</H3>
with the default <tt>strict</tt> codec error handler. For example:
</p>

<div class="code"><pre>
<div class="targetlang"><pre>
&gt;&gt;&gt; with open('test', 'w') as f:
... print(s, file=f)
...
Expand Down

0 comments on commit 20ddfb7

Please sign in to comment.