From 80b8eff6aa41ba79175a5152ba5b2b9b16f6de3f Mon Sep 17 00:00:00 2001 From: bruvzg <7645683+bruvzg@users.noreply.github.com> Date: Mon, 27 Jul 2020 13:43:20 +0300 Subject: [Complex Test Layouts] Change `String` to use UTF-32 encoding on all platforms. --- doc/classes/PackedByteArray.xml | 18 +++++++++++++-- doc/classes/String.xml | 49 +++++++++++++++++++++++++++++++++++++++-- 2 files changed, 63 insertions(+), 4 deletions(-) (limited to 'doc/classes') diff --git a/doc/classes/PackedByteArray.xml b/doc/classes/PackedByteArray.xml index 08f8558881..b1c4e54854 100644 --- a/doc/classes/PackedByteArray.xml +++ b/doc/classes/PackedByteArray.xml @@ -68,14 +68,28 @@ - Returns a copy of the array's contents as [String]. Fast alternative to [method get_string_from_utf8] if the content is ASCII-only. Unlike the UTF-8 function this function maps every byte to a character in the array. Multibyte sequences will not be interpreted correctly. For parsing user input always use [method get_string_from_utf8]. + Converts ASCII/Latin-1 encoded array to [String]. Fast alternative to [method get_string_from_utf8] if the content is ASCII/Latin-1 only. Unlike the UTF-8 function this function maps every byte to a character in the array. Multibyte sequences will not be interpreted correctly. For parsing user input always use [method get_string_from_utf8]. + + + + + + + Converts UTF-16 encoded array to [String]. If the BOM is missing, system endianness is assumed. Returns empty string if source array is not vaild UTF-16 string. + + + + + + + Converts UTF-32 encoded array to [String]. System endianness is assumed. Returns empty string if source array is not vaild UTF-32 string. - Returns a copy of the array's contents as [String]. Slower than [method get_string_from_ascii] but supports UTF-8 encoded data. Use this function if you are unsure about the source of the data. For user input this function should always be preferred. + Converts UTF-8 encoded array to [String]. Slower than [method get_string_from_ascii] but supports UTF-8 encoded data. Use this function if you are unsure about the source of the data. For user input this function should always be preferred. Returns empty string if source array is not vaild UTF-8 string. diff --git a/doc/classes/String.xml b/doc/classes/String.xml index e134ae03e0..40fff25fc4 100644 --- a/doc/classes/String.xml +++ b/doc/classes/String.xml @@ -654,6 +654,17 @@ Returns the string's amount of characters. + + + + + + + + + Formats a string to be at least [code]min_length[/code] long by adding [code]character[/code]s to the left of the string. + + @@ -695,6 +706,15 @@ Returns the MD5 hash of the string as a string. + + + + + + + Performs a case-insensitive natural order comparison to another string. Returns [code]-1[/code] if less than, [code]+1[/code] if greater than, or [code]0[/code] if equal. + + @@ -816,6 +836,17 @@ Returns the right side of the string from a given position. + + + + + + + + + Formats a string to be at least [code]min_length[/code] long by adding [code]character[/code]s to the right of the string. + + @@ -953,7 +984,7 @@ - Converts the String (which is a character array) to [PackedByteArray] (which is an array of bytes). The conversion is faster compared to [method to_utf8], as this method assumes that all the characters in the String are ASCII characters. + Converts the String (which is a character array) to ASCII/Latin-1 encoded [PackedByteArray] (which is an array of bytes). The conversion is faster compared to [method to_utf8], as this method assumes that all the characters in the String are ASCII/Latin-1 characters, unsupported characters are replaced with spaces. @@ -984,11 +1015,25 @@ Returns the string converted to uppercase. + + + + + Converts the String (which is an array of characters) to UTF-16 encoded [PackedByteArray] (which is an array of bytes). + + + + + + + Converts the String (which is an array of characters) to UTF-32 encoded [PackedByteArray] (which is an array of bytes). + + - Converts the String (which is an array of characters) to [PackedByteArray] (which is an array of bytes). The conversion is a bit slower than [method to_ascii], but supports all UTF-8 characters. Therefore, you should prefer this function over [method to_ascii]. + Converts the String (which is an array of characters) to UTF-8 encode [PackedByteArray] (which is an array of bytes). The conversion is a bit slower than [method to_ascii], but supports all UTF-8 characters. Therefore, you should prefer this function over [method to_ascii]. -- cgit v1.2.3