Merge pull request #63733 from akien-mga/file-get_as_text-skip-CR

File: Re-add support to skip CR (`\r`) in `File::get_as_text`
This commit is contained in:
Rémi Verschelde 2022-08-01 07:54:20 +02:00 committed by GitHub
commit 44f1e540f6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
15 changed files with 74 additions and 13 deletions

View file

@ -115,9 +115,10 @@
</method>
<method name="get_as_text" qualifiers="const">
<return type="String" />
<argument index="0" name="skip_cr" type="bool" default="false" />
<description>
Returns the whole file as a [String].
Text is interpreted as being UTF-8 encoded.
Returns the whole file as a [String]. Text is interpreted as being UTF-8 encoded.
If [code]skip_cr[/code] is [code]true[/code], carriage return characters ([code]\r[/code], CR) will be ignored when parsing the UTF-8, so that only line feed characters ([code]\n[/code], LF) represent a new line (Unix convention).
</description>
</method>
<method name="get_buffer" qualifiers="const">