Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

fix encoding issue and reset file stream

  • Loading branch information...
commit 2b90bf75fa330501ec874f3bacc9d8bee226ae2f 1 parent 8e58742
@posativ authored
Showing with 2 additions and 2 deletions.
  1. +1 −1  regenwolken/specs.py
  2. +1 −1  regenwolken/templates/text.html
View
2  regenwolken/specs.py
@@ -185,7 +185,7 @@ def istext(self):
blocksize = 512
chars = b''.join(int2byte(i) for i in range(32, 127)) + b'\n\r\t\f\b'
- block = self.read(blocksize)
+ block = self.read(blocksize); self.seek(0)
if b'\x00' in block:
# Files with null bytes are binary
return False
View
2  regenwolken/templates/text.html
@@ -14,7 +14,7 @@
{% elif drop.iscode and config.SYNTAX_HIGHLIGHTING %}
<pre><code>{{ drop.code | safe }}</code></pre>
{% else %}
- <pre><code>{{ drop.read() }}</code></pre>
+ <pre><code>{{ drop.read().decode("utf-8") }}</code></pre>
{% endif %}
</section>
{% endblock %}
Please sign in to comment.
Something went wrong with that request. Please try again.