diff --git a/lib/viewvcmagic.py b/lib/viewvcmagic.py index b58b1c91..f64e954b 100644 --- a/lib/viewvcmagic.py +++ b/lib/viewvcmagic.py @@ -39,7 +39,7 @@ class ContentMagic: charset = 'utf-8' try: content = content.decode('utf-8') except: charset = None - if charset is None and have_chardet: + if charset is None and have_chardet and len(content) > 64: # Try to guess with chardet try: # Only detect on first 256KB if content is longer