Skip to content
This repository was archived by the owner on Aug 31, 2021. It is now read-only.

Commit 5114d01

Browse files
author
Monte Goulding
authored
Merge pull request #1853 from bwmilby/bwm-CRfix
Line Ending Conversion Correction
2 parents 7cff5f4 + e91b84f commit 5114d01

1 file changed

Lines changed: 7 additions & 6 deletions

File tree

Toolset/libraries/revidelibrary.8.livecodescript

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5012,9 +5012,9 @@ end arrayRecurse
50125012
private function __escapeStringAndConvertLineEndings pString
50135013
replace "\" with "\\" in pString
50145014
replace quote with ("\" & quote) in pString
5015-
replace (numToChar(13) & CR) with (CR & numToChar(13)) in pString
5016-
replace (CR & numToChar(13)) with CR in pString
5017-
replace CR with "\n" in pString
5015+
replace CRLF with "\n" in pString
5016+
replace numToCodepoint(13) with "\n" in pString
5017+
replace LF with "\n" in pString
50185018
return (quote & pString & quote)
50195019
end __escapeStringAndConvertLineEndings
50205020

@@ -10688,10 +10688,11 @@ private function escape pString, pConvertLineEndings
1068810688
replace quote with ("\" & quote) in pString
1068910689

1069010690
if pConvertLineEndings is true then
10691-
replace (numToChar(13) & CR) with (CR & numToChar(13)) in pString
10692-
replace (CR & numToChar(13)) with CR in pString
10691+
replace CRLF with "\n" in pString
10692+
replace numToCodepoint(13) with "\n" in pString
1069310693
end if
10694-
replace CR with "\n" in pString
10694+
replace LF with "\n" in pString
10695+
replace numToCodepoint(13) with "\r" in pString
1069510696
//replace "<" with "&lt;" in pString
1069610697
//replace ">" with "&gt;" in pString
1069710698
replace tab with "\t" in pString

0 commit comments

Comments
 (0)