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

Commit c67eb42

Browse files
committed
Line Ending Conversion Correction
Native Mac line endings are not being converted (CRLF and LFCR are converted to LF but CR was not touched). Changed to use the LF constant to make it more readable. Also changed numToChar to numToCodepoint since the former function is deprecated.
1 parent 44c6ecd commit c67eb42

1 file changed

Lines changed: 8 additions & 6 deletions

File tree

Toolset/libraries/revidelibrary.8.livecodescript

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5012,9 +5012,10 @@ 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 (numToCodepoint(13) & LF) with (LF & numToCodepoint(13)) in pString
5016+
replace (LF & numToCodepoint(13)) with LF in pString
5017+
replace numToCodepoint(13) with LF in pString
5018+
replace LF with "\n" in pString
50185019
return (quote & pString & quote)
50195020
end __escapeStringAndConvertLineEndings
50205021

@@ -10679,10 +10680,11 @@ private function escape pString, pConvertLineEndings
1067910680
replace quote with ("\" & quote) in pString
1068010681

1068110682
if pConvertLineEndings is true then
10682-
replace (numToChar(13) & CR) with (CR & numToChar(13)) in pString
10683-
replace (CR & numToChar(13)) with CR in pString
10683+
replace (numToCodepoint(13) & LF) with (LF & numToCodepoint(13)) in pString
10684+
replace (LF & numToCodepoint(13)) with LF in pString
10685+
replace numToCodepoint(13) with LF in pString
1068410686
end if
10685-
replace CR with "\n" in pString
10687+
replace LF with "\n" in pString
1068610688
//replace "<" with "&lt;" in pString
1068710689
//replace ">" with "&gt;" in pString
1068810690
replace tab with "\t" in pString

0 commit comments

Comments
 (0)