Skip to content
This repository has been archived by the owner on Mar 28, 2024. It is now read-only.

[BUG-230960] llChar returns more than single character for some integers #8517

Closed
sl-service-account opened this issue Jul 12, 2021 · 2 comments

Comments

@sl-service-account
Copy link

What just happened?

integers between 0xD800 (55296) to 0xDFFF (57343) and 0xFFFE (65534) returns ??? instead of a single character making its impossible to use llOrd to get the integer back

What were you doing when it happened?

string ch=llChar(55296);
integer x=llOrd(ch,0);
llOwnerSay(ch);
llOwnerSay((string)x);

Returns:
???
63

What were you expecting to happen instead?

expecting llChar and llOrd to be revisable

Other information

while its possible this is correct unicode the wiki for llChar says
"Construct a single character string from the supplied Unicode value."

Original Jira Fields
Field Value
Issue BUG-230960
Summary llChar returns more than single character for some integers
Type Bug
Priority Unset
Status Closed
Resolution Triaged
Reporter Joeey Aura (joeey.aura)
Created at 2021-07-12T17:16:09Z
Updated at 2021-08-10T17:46:38Z
{
  'Build Id': 'unset',
  'Business Unit': ['Platform'],
  'Date of First Response': '2021-07-13T12:33:58.305-0500',
  "Is there anything you'd like to add?": 'while its possible this is correct unicode the wiki for llChar says \r\n"Construct a single character string from the supplied Unicode value."',
  'ReOpened Count': 0.0,
  'Severity': 'Unset',
  'System': 'SL Simulator',
  'Target Viewer Version': 'viewer-development',
  'What just happened?': 'integers between 0xD800 (55296) to 0xDFFF (57343) returns ??? instead of a single character making its impossible to use llOrd to get the integer back',
  'What were you doing when it happened?': 'string ch=llChar(55296);\r\ninteger x=llOrd(ch,0);\r\nllOwnerSay(ch);\r\nllOwnerSay((string)x);\r\n\r\nReturns: \r\n???\r\n63',
  'What were you expecting to happen instead?': 'expecting llChar and llOrd to be revisable ',
}
@sl-service-account
Copy link
Author

Rider Linden commented at 2021-07-13T17:33:58Z

The code point ranges that you specify are what are called "unpaired surrogates" and do not represent valid UTF characters.  (Please see:  Unicode.org.)

The correct behavior is to treat this as an error and return a 0 length string (as opposed to "???".)

 

@sl-service-account
Copy link
Author

Rider Linden commented at 2021-07-13T20:23:55Z

After some consultation I think the correct behavior is to return the Unicode Replacement Character � U+FFFD.

 

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

1 participant