title: Returning binary data with django HttpResponse
body: <p>I'm trying to get Django's HttpResponse to return binary data without much success. I've been trying different methods for a while now, but without success.</p>
  
  <p>Encoding the string to ASCII works as long as the binary data values aren't outside the ASCII char scope, which is smaller than 0-255. The same happened when encoding with latin-1. </p>
  
  <p>Creating byte string works nicely, but seems to fail if certain values are included, for example, if I have the following bytes included in the data: "\xf6\x52", I will get different bytes as a result. For some reason, the first byte, \xf6, gets converted to 0xfffd when I'm trying to review the result response.</p>
  
  <p>I'd love to get some feedback and help with this.</p>
  
  <p>Many thanks!</p>
  
  <p>-A-</p>