Node-Webkit Append/Write file Linebreak

Bugs will be moved here once resolved.

Post » Sun Jun 29, 2014 12:53 pm

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)
B
6
S
3
Posts: 39
Reputation: 632

Post » Mon Jul 07, 2014 2:18 pm

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.
Scirra Founder
B
399
S
236
G
89
Posts: 24,535
Reputation: 195,412


Return to Closed bugs

Who is online

Users browsing this forum: No registered users and 4 guests