Skip to content

[iOS/tvOS/MacCatalyst] String comparer for sorting numeric strings logically #109999

Open

Description

@PranavSenthilnathan

CompareOptions.NumericOrdering should be supported in Apple platforms. See #13979 for the approved API and discussion. PR #109861 adds the member CompareOptions.NumericOrdering but does not provide a conforming implementation for Apple platforms. The remaining work is to update the platform abstraction layer to support this.

PAL change would be to recognize the dotnet CompareOptions and convert it to the NSString.CompareOptions here

This is the numeric compare option documentation for reference: NSString.CompareOptions API

PR #109861 throws PlatformNotSupportedException when this option is used and skips tests that used this option, so when this is implemented, those guards can be removed.

Activity

  1. ghost added
    needs-area-label
    on Nov 20, 2024
  2. added
    untriaged
    on Nov 20, 2024
  3. added and removed
    untriaged
    needs-area-label
    on Nov 20, 2024
  4. dotnet-policy-service commented on Nov 20, 2024

    @dotnet-policy-service
    Contributor

    Tagging subscribers to this area: @dotnet/area-system-globalization
    See info in area-owners.md if you want to be subscribed.

  5. added
    os-ios
    os-tvos
    on Nov 20, 2024
  6. dotnet-policy-service commented on Nov 20, 2024

    @dotnet-policy-service
    Contributor

    Tagging subscribers to 'os-tvos': @vitek-karas, @kotlarmilos, @ivanpovazan, @steveisok, @akoeplinger
    See info in area-owners.md if you want to be subscribed.

  7. dotnet-policy-service commented on Nov 20, 2024

    @dotnet-policy-service
    Contributor

    Tagging subscribers to 'os-ios': @vitek-karas, @kotlarmilos, @ivanpovazan, @steveisok, @akoeplinger
    See info in area-owners.md if you want to be subscribed.

  8. dotnet-policy-service commented on Nov 20, 2024

    @dotnet-policy-service
    Contributor

    Tagging subscribers to 'os-maccatalyst': @vitek-karas, @kotlarmilos, @ivanpovazan, @steveisok, @akoeplinger
    See info in area-owners.md if you want to be subscribed.

  9. added
    untriaged
    on Nov 20, 2024
  10. removed
    untriaged
    on Nov 20, 2024
  11. added this to the 10.0.0 milestone on Nov 20, 2024
  12. PranavSenthilnathan commented on Jan 12, 2025

    @PranavSenthilnathan
    MemberAuthor

    Note: we rely on the stringByFoldingWithOptions native API for getting the sort key and hash code in Apple hybrid globalization, so numeric ordering can't be easily implemented for those 2 methods due to stringByFoldingWithOptions not supporting it: docs. Also, unlike the Hiragana/Katakana transformation, there doesn't seem to be a transform available for numbers so we can't work around it by preprocessing.

  13. matouskozak commented on Feb 3, 2025

    @matouskozak
    Member

    Note: we rely on the stringByFoldingWithOptions native API for getting the sort key and hash code in Apple hybrid globalization, so numeric ordering can't be easily implemented for those 2 methods due to stringByFoldingWithOptions not supporting it: docs. Also, unlike the Hiragana/Katakana transformation, there doesn't seem to be a transform available for numbers so we can't work around it by preprocessing.

    Thank you for the initial investigation. Would you like to try implementing the NumericOrdering for the APIs where Apple provides direct support?

  14. modified the milestones: 10.0.0, 11.0.0 on Jul 8, 2025
  15. removed their assignment
    on Jul 8, 2025
  16. modified the milestones: 11.0.0, Future, 12.0.0 on Jul 7, 2026
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

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions