title: InternetReadFile's output to string gives a "ÌÌÌÌÌÌ" sequence in C
body: <p>I am trying to read the text content of a HTTP Post Response body using InternetReadFile. However, all it contains is a string of "Ì" (-52 when converted to int).</p>
  
  <p>Could this be encoding related? Is it that what is being returned is not a string at all?</p>
  
  <p>Am I missing a step required to read the output?</p>
  
  <p>Please note that I know for a fact that this message body contains plain text (based on logs).</p>
  
  <p>Here is the code:</p>
  
  <pre><code>    Ptr = (char *)OutBuffer;
  
  while(TRUE)
  {
      // read the server response
      //
      if(!InternetReadFile(RequestHandle,Ptr,Length ,&amp;BytesRead))
      {
          Rc = GetLastError();
          InternetCloseHandle(RequestHandle );
          SetLastError(Rc);
          return(ACE_HTTP_ERROR);
      }
  
      if(BytesRead == 0) // end of data
          break;
  
      TotalLength += BytesRead;
      Ptr += BytesRead;
  
      if(TotalLength &gt;=  *OutBufferLength)
      {
          InternetCloseHandle(RequestHandle );
          SetLastError(ERROR_INSUFFICIENT_BUFFER);
          *OutBufferLength = TotalLength;
          return(ACE_HTTP_NO_ENOUGH_SPACE);
      }
  
  }
  
  
  *OutBufferLength =  TotalLength;
  </code></pre>
  
  <p>At this point, <code>Ptr</code>, when read as a char array, contains nothing but a sequence of 'Ì'.</p>