title: utf-8 encoded String to Buffer node.js
body: <p>On nodejs express server #1, I receive binary stream data from another nodejs Server #2 in HTTP response. I want encode this data to base64. I have problems with encoding. I did it as shown below.</p>
  <pre><code>let result = await axios.post(firmwareDownloadURL, {
          id: 'firmware1'
        }, {
          headers: {
            'Content-Type': 'application/json',
          }
        });
  let buff1 = new Buffer.from(result.data);
  let base64Firmware1 = buff1.toString('base64');
  </code></pre>
  <p>The value of <code>buff1</code> is not correct and therefore <code>base64Firmware1</code> is also wrong. I compared it by reading the firmware file from my system with fs.</p>
  <pre><code>let buff2 = fs.readFileSync('./f1.bin');
  let base64Firmware2 = buff3.toString('base64');
  </code></pre>
  <p>The <code>buff1</code> and <code>buff2</code> do not match.</p>
  <pre><code>buff &lt;Buffer ef bf bd ef bf bd ef bf bd 00 01 ef bf bd 48 ef bf bd ef bf bd 01 6d 02 08 22 ef bf bd ef bf bd 0a ef bf bd ef bf bd 6e 6d 02 08 ef bf bd 0a ef bf bd ... 612 more bytes&gt;
  
  buff2 &lt;Buffer a7 a3 fe 00 01 8d 48 a7 a6 01 6d 02 08 22 a7 a3 0a a7 a6 6e 6d 02 08 f1 a7 a3 0a a7 a6 f7 6d 02 08 b4 a7 a3 32 a7 a6 14 6e 02 08 39 a7 a3 06 a7 a6 56 ... 307 more bytes&gt;
  </code></pre>
  <p>Interestingly, when I convert <code>buff2</code> to string and compare with <code>result.data</code> they match.</p>
  <pre><code>if (buff2.toString() === result.data &amp;&amp; buff2.toString().length ==  result.data.length) {
    console.log('equal');
  }
  </code></pre>
  <p>it prints equal on console. Please help me identify, what am I missing?</p>