Skip to content

String::localeCompare support required. #12529

Description

@luochen1990
  • Version: v7.9.0
  • Platform: Windows 10 (64-bit)
  • Subsystem: none

The following code will print ["矮", "笨", "吃", "a", "b", "c"] in a uptodate browser, which is expected. But nodejs will print ["a", "b", "c", "吃", "矮", "笨"] for the same code, which is not reasonable for chinese users.

console.log(['矮', '吃', '笨', 'a', 'c', 'b'].sort((a, b) => a.localeCompare(b, 'zh-Hans-CN')))

Hope the String::localeCompare() function can be supported better, this is very useful for non-english-speaking users. thx :)

Activity

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

    docIssues and PRs related to Node.js documentation.i18n-apiIssues and PRs related to Node.js internationalization support.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions