From ad5cb8ef5eb9e02b8046f80f7cd4fae6af3d4416 Mon Sep 17 00:00:00 2001 From: kobewi Date: Wed, 10 Nov 2021 14:42:48 +0100 Subject: [PATCH] Improve store_string() description (cherry picked from commit 09b1fc1956f797bdb980caf556b3bc5e6a33ce56) --- doc/classes/File.xml | 1 + 1 file changed, 1 insertion(+) diff --git a/doc/classes/File.xml b/doc/classes/File.xml index 6fc54aacf0e..2d3c335ade1 100644 --- a/doc/classes/File.xml +++ b/doc/classes/File.xml @@ -373,6 +373,7 @@ Appends [code]string[/code] to the file without a line return, encoding the text as UTF-8. + [b]Note:[/b] This method is intended to be used to write text files. The string is stored as a UTF-8 encoded buffer without string length or terminating zero, which means that it can't be loaded back easily. If you want to store a retrievable string in a binary file, consider using [method store_pascal_string] instead. For retrieving strings from a text file, you can use [code]get_buffer(length).get_string_from_utf8()[/code] (if you know the length) or [method get_as_text].