Skip to content

Improved support for localeCompare #10617

Closed as not planned
Closed as not planned

Description

@fpaaske

Issue Description

A small followup on #7810;

I've tested this on Node, Safari, Edge and Chrome, they all produce the expected outcome for me:

['æ','ø','å','Å','Æ','Ø', 'A', 'a', 'B', 'b'].sort((a, b) => a.localeCompare(b, 'nb', {sensitivity:'case', usage: 'sort'}))
[
"a",
"A",
"b",
"B",
"æ",
"Æ",
"ø",
"Ø",
"å",
"Å"
]

So I'd assume that this should also be supported in NativeScript with V8?
But it seems like the locale and option parameters are completely ignored.

Is this still something that's out of NativeScript's control?

Reproduction

Create an array with 'æ', 'ø', and 'å', sort with localeCompare as the example above.
The array is now incorrectly sorted as 'å', 'æ', 'ø'.

Relevant log output (if applicable)

No response

Environment

No response

Please accept these terms

Activity

  1. NathanWalker commented on Oct 23, 2026

    @NathanWalker
    Contributor

    Duplicate of #11563

    localeCompare ignoring the locale and options comes from the runtimes being built without ICU. #11563 tracks shipping the V8 runtimes with ICU so Intl and locale-aware string comparison work.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions