Inconsistancy in calculating string lengths when using extended characters
needs info
Mars Tamale
llStringLength delivers number of extended characters which is consistant with its Wiki docs.
llDialog limits are based on the actual number of bytes in the string which can of course be 4x that.
Recommendation: Update the Wiki to warn scripters against using UTF-8 or UTF-16 characters in llDialog messages or at least explain that its not the number of characters but the number of bytes.
Log In
Mars Tamale
It's true the docs (now since Jan 2024) say bytes & not characters. But I think it needs highlighting as many could misread it & consider them to be the same. Especially as most of the rest of LSL works on characters not bytes.
Also why is that a limit anyway when the reason given is so the dialog doesn't extend below the window (not that that really matters, just allow scrolling & rely on Stack?heap collision to trap it)?
Maestro Linden
needs info
Hi Mars Tamale do you have suggested language for the wiki?
It looks to me like the 2 function pages are already pretty clear about whether the limit is in bytes vs characters:
* https://wiki.secondlife.com/wiki/LlDialog indicates "message must be fewer than 512 bytes in length"
* https://wiki.secondlife.com/wiki/LlStringLength indicates "llStringLength() gets the number of characters, not bytes \ LSL-2 sees all strings as UTF-8 \ LSL-Mono sees all string as UTF-16 \ Both UTF-8 and UTF-16 use multibyte characters"