File: Re-add support to skip CR (\r) in File::get_as_text
This was removed in #63481, and we confirmed that it's better like this, but we add back the possibility to strip CR as an option, to optionally restore the previous behavior. For performance this is done directly in `String::parse_utf8`. Also fixes Android `FileAccess::get_line()` as this one _should_ strip CR. Supersedes #63717.
This commit is contained in:
1
tests/data/line_endings_cr.test.txt
Normal file
1
tests/data/line_endings_cr.test.txt
Normal file
@ -0,0 +1 @@
|
||||
Hello darkness
|
||||
4
tests/data/line_endings_crlf.test.txt
Normal file
4
tests/data/line_endings_crlf.test.txt
Normal file
@ -0,0 +1,4 @@
|
||||
Hello darkness
|
||||
My old friend
|
||||
I've come to talk
|
||||
With you again
|
||||
4
tests/data/line_endings_lf.test.txt
Normal file
4
tests/data/line_endings_lf.test.txt
Normal file
@ -0,0 +1,4 @@
|
||||
Hello darkness
|
||||
My old friend
|
||||
I've come to talk
|
||||
With you again
|
||||
Reference in New Issue
Block a user