IslandzVW / halcyon

InWorldz Halcyon 3d virtual reality world simulator
BSD 3-Clause "New" or "Revised" License
21 stars 26 forks source link

Scripts, and possibly notecards, are being saved with CRLF line endings #424

Closed kf6kjg closed 6 years ago

kf6kjg commented 6 years ago

This causes a SL script incompatibility.

Consider the following script:

string str = "Halo
Whirld";

default {
    state_entry() {
        llOwnerSay(str);
        list dat = llParseStringKeepNulls(str, ["\n"], []);
        llOwnerSay("First word has " + (string)llStringLength(llList2String(dat, 0)) + " chars");
        llOwnerSay("Second word has " + (string)llStringLength(llList2String(dat, 1)) + " chars");
    }
}

In IW Halcyon 0.9.37.6622 the output is thus:

Halo
Whirld
First word has 5 chars
Second word has 6 chars

In SL Second Life Server 18.01.17.511913 the output is thus:

Halo
Whirld
First word has 4 chars
Second word has 6 chars
kf6kjg commented 6 years ago

I discovered this problem some time ago, fixed a script and forgot about it. That "some time ago" was probably before Halcyon was named and released! I'd worked around it by created a global string that had an llDecodeURL of 0D and using that global in the parse operation and subsequent for-loop filter used in that original project.

kf6kjg commented 6 years ago

This issue was moved to HalcyonGrid/halcyon#5