Ticket #2672: trac-0.11.2.1-dont_show_binary_pdf_differences.diff
| File trac-0.11.2.1-dont_show_binary_pdf_differences.diff, 460 bytes (added by public@…, 3 years ago) |
|---|
-
trac/mimeview/api.py
old new def is_binary(data): 421 421 """ 422 422 if isinstance(data, str) and detect_unicode(data): 423 423 return False 424 return '\0' in data[:1000]424 return ('\0' in data[:1000]) or data.startswith('%PDF-') 425 425 426 426 def detect_unicode(data): 427 427 """Detect different unicode charsets by looking for BOMs (Byte Order Marks).
