Javascript and PHP: Downloaded file doesn’t show new lines but rn

I’m trying to generate content in PHP that’s then going to be downloaded via JavaScript.

So now, I’m calling the PHP function from JavaScript:

fetch("retrieveContent.php", options)
    .then(response => response.text())
    .then(response=> {
      $("#container-result").val(response);
      saveFile(response.replaceAll('"', ''), $("#nomeFileTelematico").val());
    })

The saveFile function:

var saveFile = (function () {
  var a = document.createElement("a");
  document.body.appendChild(a);
  a.style = "display: none";

  return function (data, fileName) {
    console.log(data);
    var blob = new Blob([data], {type: "text/plain;charset=utf-8"});
    var url = window.URL.createObjectURL(blob);
    a.href = url;
    a.download = fileName;
    a.click();
  };

}());

The variable data contains the literal characters rn and is generated by PHP:

$endLine = "rn";
    
// RECORD DI TESTA
$content .= $blabla
         . $endLine;

echo json_encode($content);

How can I treat this characters in order to be visualized as an actual new line by Windows?

For now, here’s what part the file looks like:

LRN****16L015MZZL****1M16L0***2024A      531      212rn9QSS000***413102**FI** - ************************MANTO

You can see the rn in the middle of the line.

I already tried to set the characters of $endLine as chr(13) and chr(10) but nothing worked.

I’m using the note app built in Windows.