qgis / QGIS

QGIS is a free, open source, cross platform (lin/win/mac) geographical information system (GIS)
https://qgis.org
GNU General Public License v2.0
10.43k stars 2.99k forks source link

Incorrect Turkish locale behavior (on Windows) #30573

Open i-s-o opened 5 years ago

i-s-o commented 5 years ago

The bug Turkish locale behavior is incorrect on Windows:

  1. Currency symbol shows before the amount, instead of after (at least in the dialog box sample).
  2. Sorting mixes characters with and without diacritics together.
  3. upper()/lower() functions in QGIS are not locale-aware, however, even toUpper()/toLower() from PyQt.QtCore.QLocale class don't produce the expected outcomes: a. toUpper('i') -> 'I' (instead of 'İ') b. toLower('I') -> 'i' (instead of 'ı') See: https://en.wikipedia.org/wiki/Dotted_and_dotless_I

How to Reproduce turkish-uppercase.zip

  1. Create a new, clean profile in QGIS, e.g. "tr".
  2. Extract "turkish-uppercase.py" custom Python expression function file from the attached zip into %AppData%\QGIS\QGIS3\profiles\tr\python\expressions.
  3. In QGIS Settings/Options/General, enable "Override system locale", change the Locale to "Turkish Turkey (tr_TR)", and restart QGIS.
  4. Extract the project and the data files from the zip into a folder (the data file is from NaturalEarth, it is a zipped shapefile: keep it as is).
  5. Open the print layout, and run the atlas.
  6. Observe the errors: a. E.g. all countries starting with "C" should be listed before the counties starting with "Ç". b. Capitalized version of Israel in Turkish should be "İSRAİL".

Windows: wrong placement of the currency symbol qgis-ltr-bin_2019-07-02_14-27-17

Ubuntu: correct placement of the currency symbol VirtualBoxVM_2019-07-02_14-25-58

Windows: wrong sort order & capitalization qgis-dev-bin-g7_2019-07-05_11-53-26

Ubuntu: correct sort order & capitalization VirtualBoxVM_2019-07-05_18-47-46

QGIS and OS versions QGIS version: 3.9.0-Master; code revision: accbb2d7f1 Compiled/Running against Qt: 5.11.2 Compiled/Running against GDAL/OGR: 2.4.1 Compiled/Running against GEOS: 3.7.2-CAPI-1.11.0 b55d2125 PostgreSQL Client Version: 9.2.4; SpatiaLite Version: 4.3.0 QWT Version: 6.1.3; QScintilla2 Version: 2.10.8 Compiled/Running against PROJ: Rel. 5.2.0, September 15th, 2018

OS Version Windows 10 (10.0) CPU Type: x86_64 Kernel Version: 10.0.17763

Additional context This is working as expected under Ubuntu 18.04.

Pedro-Murteira commented 2 years ago

This issue is still valid on QGIS 3.22.4 and 3.24.0.