Python Forum
What are the possible values for LC_COLLATE ?
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
What are the possible values for LC_COLLATE ?
#1
Hi

To collate ancien greek words, I tried, without any success, to set LC_COLLATE.
Here is an exemple of my tries
>>> import locale
>>> for l in ('en_US', 'de_DE', 'fr_FR', 'el_GR', 'gr_GR'):
...     try:
...             locale.setlocale(locale.LC_COLLATE, '.'.join([l, 'UTF-8']))
...     except:
...             print("«"+'.'.join([l, 'UTF-8']) + "» n'est pas une valeur reconnue")
... 
'en_US.UTF-8'
«de_DE.UTF-8» n'est pas une valeur reconnue
'fr_FR.UTF-8'
«el_GR.UTF-8» n'est pas une valeur reconnue
«gr_GR.UTF-8» n'est pas une valeur reconnue
It is reasonable to assume that «de_DE.UTF-8», «el_GR.UTF-8», «gr_GR.UTF-8» are unknown in my Ubuntu system, and that this question is not quite related to Python. But, hopefully, one of you may advice me on how to create this collating sequences. The one I'm really looking for is «el_GR.UTF-8», as I believe «gr_GR.UTF-8» refers to modern greek.

Arbiel
Reply
#2
LC_COLLATE is string sort order
documentation from interactive python:
>>> import sys
>>> sys.stdout = open('locale_LC_COLLATE.txt', 'w')
>>> import locale
>>> help(locale.LC_COLLATE)
>>> quit()
yields:
see attachment:

.doc   locale_LC_COLLATE.doc (Size: 6.94 KB / Downloads: 197)
Reply
#3
Hi Larz60+

Thank you for your help.

Unfortunately neither the attachment nor your script gives any information on LC_COLLATE, but on the contrary on the int objects.

However, your script shows how to redirect output from the console to a file.

Arbiel
Reply


Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020