Bug 137716 - Incorrect sorting order for Persian (a.k.a Farsi) text
Summary: Incorrect sorting order for Persian (a.k.a Farsi) text
Status: NEW
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Calc (show other bugs)
Version:
(earliest affected)
Inherited From OOo
Hardware: All All
: medium minor
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: Sorting
  Show dependency treegraph
 
Reported: 2020-10-24 07:33 UTC by MohammadReza Hosseini
Modified: 2025-11-11 09:09 UTC (History)
3 users (show)

See Also:
Crash report or crash signature:


Attachments
test words in incorrect sorting order (32 bytes, text/plain)
2025-11-11 07:53 UTC, MohammadReza Hosseini
Details

Note You need to log in before you can comment on or make changes to this bug.
Description MohammadReza Hosseini 2020-10-24 07:33:54 UTC
Description:
When sorting columns containing Persian (a.k.a Farsi) text in ascending order, the Persian letter Heh 'ه' is placed before letter Waw 'و', which is incorrect while in the correct order 'و' must be before 'ه'. The bug probably affects similar languages like Arabic because the same order of letters are there too.

Steps to Reproduce:
1. Type the letter 'ه' in a cell.
2. Type the letter 'و' in the next cell in column.
3. Sort the column in ascending order.

Actual Results:
'ه' is placed before 'و'

Expected Results:
'ه' must be after 'و'


Reproducible: Always


User Profile Reset: No



Additional Info:
Version: 7.0.2.2
Build ID: 00(Build:2)
CPU threads: 4; OS: Linux 5.4; UI render: default; VCL: kf5
Locale: en-US (en_US.UTF-8); UI: en-US
Ubuntu package version: 1:7.0.2~rc2-0ubuntu0.20.04.2
Calc: threaded
Comment 1 Buovjaga 2021-07-27 13:09:30 UTC
Repro

NixOS
Version: 7.3.0.0.alpha0+ / LibreOffice Community
Build ID: 67e47070a7580a17804adce812cc2f98bfe7b51f
CPU threads: 16; OS: Linux 5.13; UI render: default; VCL: x11
Locale: fi-FI (fi_FI.UTF-8); UI: en-US
Calc: threaded
Comment 2 Buovjaga 2021-08-14 17:42:13 UTC
Seen in Linux bibisect repos 6.3, 41max, 43all. Assuming inherited.
Comment 3 Ming Hua 2021-08-14 18:31:52 UTC
I know nothing about Persian or Arabic, but it seems from a Persian MS Office user [1] that Persian and Arabic indeed have slightly different alphabetical order, and MS Office exhibits a similar problem for Persian users.

1. https://answers.microsoft.com/en-us/msoffice/forum/all/persian-alphabet-or-arabic-alphabet/1930e610-6439-4858-94bc-833aad8c61b5
Comment 4 MohammadReza Hosseini 2021-08-15 06:27:34 UTC
(In reply to Ming Hua from comment #3)
> I know nothing about Persian or Arabic, but it seems from a Persian MS
> Office user [1] that Persian and Arabic indeed have slightly different
> alphabetical order, and MS Office exhibits a similar problem for Persian
> users.
> 
> 1.
> https://answers.microsoft.com/en-us/msoffice/forum/all/persian-alphabet-or-
> arabic-alphabet/1930e610-6439-4858-94bc-833aad8c61b5

I checked the Arabic alphabet and you are correct. In Arabic alphabet the letter 'و' comes after 'ه'. So this bug only affects Persian language.
Comment 5 QA Administrators 2023-08-16 03:06:00 UTC Comment hidden (obsolete)
Comment 6 MohammadReza Hosseini 2023-08-17 08:21:01 UTC
The bug is still present.

Version: 7.3.7.2 / LibreOffice Community
Build ID: 30(Build:2)
CPU threads: 12; OS: Linux 6.2; UI render: default; VCL: kf5 (cairo+xcb)
Locale: en-US (en_US.UTF-8); UI: en-US
Ubuntu package version: 1:7.3.7-0ubuntu0.22.04.3
Calc: threaded
Comment 7 QA Administrators 2025-08-17 03:11:55 UTC Comment hidden (obsolete)
Comment 8 Regina Henschel 2025-11-06 21:52:46 UTC
Please attach a document with a list of example words that show the error when sorting, but do not actually sort it.

Please use a daily build for testing, as there have been some recent improvements to the Sort dialog. When testing, make sure that you have selected "Persian" in the section Locale on tab Options of the Sort dialog. Do not use "Default - ...", because that is not written to the file.

Please look at https://icu4c-demos.unicode.org/icu-bin/collation.html and test your list of words there.
Comment 9 MohammadReza Hosseini 2025-11-11 07:53:14 UTC
Created attachment 203867 [details]
test words in incorrect sorting order

Attached is a list of words in incorrect sorting order.
Comment 10 MohammadReza Hosseini 2025-11-11 08:01:32 UTC
Using "Sort" dialog and setting language to "Persian" on tab Options, the sorting order is correct.


Version: 24.2.7.2 (X86_64) / LibreOffice Community
Build ID: 420(Build:2)
CPU threads: 12; OS: Linux 6.8; UI render: default; VCL: kf5 (cairo+xcb)
Locale: en-US (en_US.UTF-8); UI: en-US
Ubuntu package version: 4:24.2.7-0ubuntu0.24.04.4
Calc: threaded
Comment 11 Buovjaga 2025-11-11 09:09:54 UTC
(In reply to MohammadReza Hosseini from comment #10)
> Using "Sort" dialog and setting language to "Persian" on tab Options, the
> sorting order is correct.
> 
> 
> Version: 24.2.7.2 (X86_64) / LibreOffice Community
> Build ID: 420(Build:2)
> CPU threads: 12; OS: Linux 6.8; UI render: default; VCL: kf5 (cairo+xcb)
> Locale: en-US (en_US.UTF-8); UI: en-US
> Ubuntu package version: 4:24.2.7-0ubuntu0.24.04.4
> Calc: threaded

So is there a problem even in 24.2? It's not clear from your reaction. If there is still a problem, please do as Regina says and use a fresh 26.2 build: https://wiki.documentfoundation.org/Installing_in_parallel/Linux#Automated_installation

Or do it manually
https://wiki.documentfoundation.org/Installing_in_parallel/Linux#Manual_installation
https://dev-builds.libreoffice.org/daily/master/current.html