gokcehan / lf

Terminal file manager
MIT License
7.8k stars 330 forks source link

Sort_by function not work very well with hungarian letters #1732

Closed og900aero closed 6 months ago

og900aero commented 6 months ago

Sort of accented characters does not yet work properly.

screenshot_1716747075

Here you can see that it doesn't handle accented characters properly because it actually sorts by the second letter.

The correct sequence is always the following regardless of what the second character contains

A.... Á.... ... E É ... I Í ... O Ó Ö Ő ... U Ú Ü Ű ...

joelim-work commented 6 months ago

The problem is that ignoredia doesn't handle this requirement:

I don't know if there's a way to implement this using the Go standard library, if not then it might not be feasible to implement this.

og900aero commented 6 months ago

The problem is that ignoredia doesn't handle this requirement:

  • If ignoredia is disabled then the characters will be sorted by their Unicode code point (accented characters come after regular characters).
  • If ignoredia is enabled then accented characters will be translated to their corresponding regular characters before sorting. But then this means a and á are treated as equivalent and there is no way to enforce an ordering between them.

I don't know if there's a way to implement this using the Go standard library, if not then it might not be feasible to implement this.

I disabled ignoredia, but doesnt good -> it became worse

screenshot_1716806555