GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — localCompare not working with 'Umlaut' · Issue #7810 · NativeScript/NativeScript

localCompare not working with 'Umlaut' #7810

New issue
Copy link
New issue
Copy link
Closed
Closed
localCompare not working with 'Umlaut'#7810
Copy link
Assignees
tsonevn

Description

@Bidou44
Bidou44
opened on Sep 11, 2019
Issue body actions

Environment
✔ Getting NativeScript components versions information...
⚠ Update available for component nativescript. Your current version is 5.4.2 and the latest available version is 6.1.0.
⚠ Update available for component tns-core-modules. Your current version is 5.2.0 and the latest available version is 6.1.1.
⚠ Update available for component tns-android. Your current version is 5.4.0 and the latest available version is 6.1.0.
⚠ Update available for component tns-ios. Your current version is 5.4.2 and the latest available version is 6.1.0.

Describe the bug
Using the localeCompare function to sort a list does not work with ¨ (the Umlaut german character). For example, the country Österreich appears at the end of my country list (so for example, after Vietnam)

To Reproduce
export class Country {
public name: string;
}

let countries: Array = ...;
countries = countries.sort((first, second) => {
return first.name == null ? -1 : first.name.localeCompare(second.name, 'de');
});

Expected behavior
Österreich should be for example between Norway and Poland and not at the end of the country list.

Sample project

Additional context
For countries without ¨ (Umlaut) it works as expected.

Activity

  1. tsonevn
    self-assigned this
    on Sep 12, 2019
  2. tsonevn commented on Sep 12, 2019

    @tsonevn
    tsonevn
    on Sep 12, 2019
    Contributor
    More actions

    Hi @Bidou44,
    The implementation of the localeCompare comes from V8 for Android and Apple's JavaScriptCore for iOS. On that matter, this behaviour does not seem to be caused by NativeScript core modules. I found this thread in the V8 forum, where a similar case is discussed.

  3. Bidou44 commented on Sep 12, 2019

    @Bidou44
    Bidou44
    on Sep 12, 2019
    Author
    More actions

    Ok thank you for that quick response.
    Will close this issue since it seems to not be related to nativescript....

    Reacted by Nikolay Tsonev
  4. Bidou44
    closed this as completedon Sep 12, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

  • @tsonevn
    tsonevn

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

    You are visitor 01402503 — GeezerVison does not store the pages you look up.
    Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.