Node-Webkit Append/Write file Linebreak

0 favourites
  • 2 posts
From the Asset Store
Excel2JSON
$1.20 USD
60% off
Convert multiple Excel files into JSON files and import them into construct3.
  • Problem Description

    When Writing or Appending a file using Node-Webkit, newline seems to be ignored when the exported file is opened in notepad, it however works for other text editors i.e notepad++ or wordpad, its still an issue since i would assume notepad is the most common text editor since its a default.

    With Javascript \n is acceptable for newline on most nix systems, but windows insists on \r\n

    Couldnt upload Capx, kept saying "The uploaded file is empty"

    Steps to Reproduce Bug

    • On Start of Layout > NodeWebKit:WriteFile > Path: nodewebkit.appfolder & "example.txt" Contents: "Line 1" & newline & "Line 2" & newline & "Line 3"
    • Export to Node-Webkit
    • run executable
    • open example.txt with notepad

    Observed Result

    The text shows as:

    Line1Line2Line3

    Expected Result

    The text should show as:

    Line1

    Line2

    Line3

    Operating System and Service Pack

    Windows 7 X64 Ultimate SP1

    Construct 2 Version ID

    173 (64 Bit)

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • Closing as won't fix: by design newline is just a \n character, whereas Windows is old and crusty and wants to see \r\n in some tools like notepad. I think it would be best just to use a different tool like notepad++ which understands these line endings. We could add a feature to add carriage returns in to strings, but I think that would just cause other compatibility issues, since for example nix systems will not want to see the \r characters.

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)