Fix the text-based attachment diffs with Unicode characters.

Review Request #7694 — Created Oct. 13, 2015 and submitted

Information

Review Board
release-2.5.x

Reviewers

The diff viewer code, which is used for text-based attachment diffs,
expects data to be converted to Unicode for display, and to do this, we
run the text through convert_unicode(). However, this only happens if
there's an encoding list set up, which there isn't by default. Diffs
backed by repositories do this because we always have a default encoding
list, but there was no such logic here.

Now, the diff viewer provides a default for the encoding list, and it
also unconditionally runs convert_unicode(). This allows text-based
attachments with Unicode characters to properly render.

Some file attachments I tried that were failing now properly render.

reviewbot
  1. Tool: Pyflakes
    Processed Files:
        reviewboard/diffviewer/chunk_generator.py
    
    
    
    Tool: PEP8 Style Checker
    Processed Files:
        reviewboard/diffviewer/chunk_generator.py
    
    
  2. 
      
david
  1. Ship It!
  2. 
      
chipx86
Review request changed
Status:
Completed
Change Summary:
Pushed to release-2.5.x (6e3e5de)