Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support locale-correct orderby() using localeCompare. #368

Closed
jheer opened this issue Sep 24, 2024 Discussed in #366 · 0 comments · Fixed by #371
Closed

Support locale-correct orderby() using localeCompare. #368

jheer opened this issue Sep 24, 2024 Discussed in #366 · 0 comments · Fixed by #371
Labels
enhancement New feature or request

Comments

@jheer
Copy link
Member

jheer commented Sep 24, 2024

Discussed in #366

Originally posted by agladysh September 24, 2024
Problem:

çilek
erik
şeftali
armut
üzüm

By default, orderby() gives incorrect (for tr-TR locale) sorting order:

aq.fromCSV(csv, { header: false }).orderby('col1').toCSV()
armut
erik
çilek
üzüm
şeftali

Correct order would be:

armut
çilek
erik
şeftali
üzüm

One can achieve that by using String.localeCompare() in the comparator:

(lhs, rhs) => lhs.localeCompare(rhs, 'tr-TR');

Is there a way to feed this comparator to the Arquero somehow?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant