Bug 157822 - BASIC: Strings are not limited to 64 000 characters, nor to ASCII, as declared in help
Summary: BASIC: Strings are not limited to 64 000 characters, nor to ASCII, as declare...
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Documentation (show other bugs)
Version:
(earliest affected)
unspecified
Hardware: All All
: medium normal
Assignee: fpy
URL:
Whiteboard: target:24.8.0
Keywords:
Depends on:
Blocks: HelpGaps-NewFeatures
  Show dependency treegraph
 
Reported: 2023-10-19 06:22 UTC by Mike Kaganski
Modified: 2024-03-11 22:52 UTC (History)
1 user (show)

See Also:
Crash report or crash signature:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Mike Kaganski 2023-10-19 06:22:23 UTC
Dim Statement help page [1] tells:

> String: String variable consisting of a maximum of 64,000 ASCII characters.

This is not true: the strings can have up to almost 2^31 Unicode characters (strictly speaking, the current implementation, based on rtl::OUString, can hold up to 2 147 483 642 UTF-16 code units exactly).

[1] https://help.libreoffice.org/latest/en-US/text/sbasic/shared/03102100.html?DbPAR=BASIC
Comment 1 Mike Kaganski 2023-10-19 06:37:20 UTC
Oh, and I learned now, that since commit a44c9d023041c881f7858ddd9d93809dc1861313, on 64-bit systems, strings may safely contain exactly 2^31 - 1 = 2 147 483 647 characters. Not a huge difference, just getting more pedant points into karma :)
Comment 2 Commit Notification 2024-03-11 16:17:52 UTC
Pierre F committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/help/commit/4e1458853a317d6efbc222e7719e06be10d98817

fix String limit  text/sbasic/shared/03102100 tdf#157822