Fix the handling of binary data when reading in diff files in javascript.

Review Request #6364 — Created Sept. 23, 2014 and submitted

Information

Review Board
release-2.0.x
e43ebf7...

Reviewers

Our drop-in replacement for File.readAsBinaryString wasn't entirely drop-in, in
that if it encountered any bytes > 127, it would fail with an
InvalidCharacterError, which would get translated into a fake ajax error that
said "HTTP 0" (which I don't have to tell you is completely useless). The
problem here was that we were using Int8Array instead of Uint8Array to convert
each byte into a String.

Made a diff that added a BOM to a utf-8 file. Tried to upload that diff and got
the same mysterious HTTP errors that appeared before any HTTP request got made.
After this change, the diff uploads correctly and I can see the added BOM in
the diff viewer.

reviewbot
  1. Tool: Pyflakes
    Ignored Files:
        reviewboard/static/rb/js/resources/models/baseResourceModel.js
    
    
    
    Tool: PEP8 Style Checker
    Ignored Files:
        reviewboard/static/rb/js/resources/models/baseResourceModel.js
    
    
  2. 
      
david
chipx86
  1. Ship It!

  2. 
      
david
Review request changed
Status:
Completed
Change Summary:
Pushed to release-2.0.x (e7e671a)