From b496757eaeb873dc614590dfeace7c88fd4682e9 Mon Sep 17 00:00:00 2001 From: Robin Dunn Date: Fri, 10 Jan 2003 00:06:55 +0000 Subject: [PATCH] Use locale specific sort comparissons git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_2_4_BRANCH@18651 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- wxPython/wxPython/lib/mixins/listctrl.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/wxPython/wxPython/lib/mixins/listctrl.py b/wxPython/wxPython/lib/mixins/listctrl.py index 0e49c11307..c422c17cad 100644 --- a/wxPython/wxPython/lib/mixins/listctrl.py +++ b/wxPython/wxPython/lib/mixins/listctrl.py @@ -11,6 +11,7 @@ #---------------------------------------------------------------------------- from wxPython.wx import * +import locale #---------------------------------------------------------------------------- @@ -105,7 +106,12 @@ class wxColumnSorterMixin: item1 = self.itemDataMap[key1][col] item2 = self.itemDataMap[key2][col] - cmpVal = cmp(item1, item2) + #--- Internationalization of string sorting with locale module + if type(item1) == type('') or type(item2) == type(''): + cmpVal = locale.strcoll(str(item1), str(item2)) + else: + cmpVal = cmp(item1, item2) + #--- # If the items are equal then pick something else to make the sort value unique if cmpVal == 0: