Skip to content

fix(developer): support surrogate pairs in ldml debugger 🌱#10532

Merged
mcdurdin merged 1 commit intoepic/core/9999-normalizationfrom
fix/developer/10501-ldml-debugger-surrogate-pairs
Jan 30, 2024
Merged

fix(developer): support surrogate pairs in ldml debugger 🌱#10532
mcdurdin merged 1 commit intoepic/core/9999-normalizationfrom
fix/developer/10501-ldml-debugger-surrogate-pairs

Conversation

@mcdurdin
Copy link
Copy Markdown
Member

@mcdurdin mcdurdin requested a review from darcywong00 as a code owner January 29, 2024 03:59
@keymanapp-test-bot
Copy link
Copy Markdown

User Test Results

Test specification and instructions

User tests are not required

@keymanapp-test-bot keymanapp-test-bot bot changed the title fix(developer): support surrogate pairs in ldml debugger fix(developer): support surrogate pairs in ldml debugger 🌱 Jan 29, 2024
@keymanapp-test-bot keymanapp-test-bot bot added this to the A17S31 milestone Jan 29, 2024
function ContextItemsLengthUTF16(pc: pkm_core_context_item): Integer;
begin
Result := 0;
while pc._type <> KM_CORE_CT_END do
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it possible for context items to never contain KM_CORE_CT_END?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, that's contractual on the part of the Core API:

* @param out A pointer to the result variable: A pointer to the start
* of the `km_core_context_item` array containing a copy of
* the context. Terminated with a type of `KM_CORE_CT_END`.

SetLength(outText, length + 1);

ox := 0;
Result := '';
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this initialize to something with Result.Length = 0? Could a loop enter the else block on the first pass and hit l.514?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Result := '' means that Result.Length = 0; .Length is a calculated property

Copy link
Copy Markdown
Contributor

@darcywong00 darcywong00 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@mcdurdin mcdurdin merged commit 46d162d into epic/core/9999-normalization Jan 30, 2024
@mcdurdin mcdurdin deleted the fix/developer/10501-ldml-debugger-surrogate-pairs branch January 30, 2024 00:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

chore(developer): verify that surrogate pairs are handled correctly in the LDML debugger

2 participants