newLine() produces wrong result on Windows

Description

newLine() fails to generate a proper caret return on Windows.

Reproduction Code:

See screenshots of results on Mac and Windows as attached below.

Environment

Windows Server 2008 R2 with Lucee 5.2.8.50

Attachments

1

Activity

Show:

Da Li 21 August 2018 at 03:19

Michael Offner 20 August 2018 at 18:17

my fault, i was under the impression that function also exists on ACF, but it does not.
So it is up to us what is right, so i decided that CR+LF is the right value for windows, so the value we already had in the server scope.
But in addition i have extended the function "newLine" with a new optional argument "includeCROnWindows"
what is true by default, but also can set to false to get the old behaviour.

https://github.com/lucee/Lucee/commit/366c49c77d23769c3ac7dbbb496203cae321267e

Michael Offner 20 August 2018 at 17:52

you missunderstand me, is "newLine" returning the wrong value or "server.separator.line" ?
i understand that they not return the same on windows, but what is the right return value?

Pothys - MitrahSoft 20 August 2018 at 15:45

Hi ,

Both were return's to the new line. But In windows if we check both are equal it return's false. I checked in trycf it return's true.

Da Li 20 August 2018 at 14:59
Edited

The change of behavior of newLine() between Lucee versions caused a severe issue in our system where lines aren't separated anymore in the text files that are meant to be imported into database.

I ideally thought newLine() is a shortcut to SERVER.separator.line so that I can save a few keystrokes. The issue doesn't happen on Mac so that we failed to catch the abnormality.

Everything was fine with Lucee 2.5.6.60 on both Windows and Mac, though.

Fixed

Details

Assignee

Reporter

Priority

Fix versions

New Issue warning screen

Before you create a new Issue, please post to the mailing list first https://dev.lucee.org

Once the issue has been verified, one of the Lucee team will ask you to file an issue

Sprint

Affects versions

Created 20 August 2018 at 04:15
Updated 4 September 2018 at 19:26
Resolved 23 August 2018 at 06:21