From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.bugs Subject: bug#12008: Alphabetic sorting respect user's language and/or locale Date: Sun, 22 Jul 2012 06:24:31 -0400 Message-ID: References: <500ABD92.5050104@gmx.at> <83liid14u0.fsf@gnu.org> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: dough.gmane.org 1342952740 10310 80.91.229.3 (22 Jul 2012 10:25:40 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Sun, 22 Jul 2012 10:25:40 +0000 (UTC) Cc: 12008@debbugs.gnu.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sun Jul 22 12:25:39 2012 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1SstM3-0003sQ-I0 for geb-bug-gnu-emacs@m.gmane.org; Sun, 22 Jul 2012 12:25:39 +0200 Original-Received: from localhost ([::1]:42932 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SstM2-0007fE-OG for geb-bug-gnu-emacs@m.gmane.org; Sun, 22 Jul 2012 06:25:38 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:39218) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SstM0-0007f9-5b for bug-gnu-emacs@gnu.org; Sun, 22 Jul 2012 06:25:36 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SstLz-0007jf-Bg for bug-gnu-emacs@gnu.org; Sun, 22 Jul 2012 06:25:36 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:47373) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SstLz-0007jb-82 for bug-gnu-emacs@gnu.org; Sun, 22 Jul 2012 06:25:35 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.72) (envelope-from ) id 1SstSD-0003Yw-UM for bug-gnu-emacs@gnu.org; Sun, 22 Jul 2012 06:32:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Stefan Monnier Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 22 Jul 2012 10:32:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 12008 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 12008-submit@debbugs.gnu.org id=B12008.134295306513630 (code B ref 12008); Sun, 22 Jul 2012 10:32:01 +0000 Original-Received: (at 12008) by debbugs.gnu.org; 22 Jul 2012 10:31:05 +0000 Original-Received: from localhost ([127.0.0.1]:56919 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1SstRJ-0003Xm-DA for submit@debbugs.gnu.org; Sun, 22 Jul 2012 06:31:05 -0400 Original-Received: from chene.dit.umontreal.ca ([132.204.246.20]:44870) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1SstRH-0003Xf-GF for 12008@debbugs.gnu.org; Sun, 22 Jul 2012 06:31:04 -0400 Original-Received: from fmsmemgm.homelinux.net (lechon.iro.umontreal.ca [132.204.27.242]) by chene.dit.umontreal.ca (8.14.1/8.14.1) with ESMTP id q6MAOWrD008505; Sun, 22 Jul 2012 06:24:33 -0400 Original-Received: by fmsmemgm.homelinux.net (Postfix, from userid 20848) id 9CF64AE17C; Sun, 22 Jul 2012 06:24:31 -0400 (EDT) In-Reply-To: <83liid14u0.fsf@gnu.org> (Eli Zaretskii's message of "Sat, 21 Jul 2012 19:01:11 +0300") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.1.50 (gnu/linux) X-NAI-Spam-Flag: NO X-NAI-Spam-Threshold: 5 X-NAI-Spam-Score: 0 X-NAI-Spam-Rules: 1 Rules triggered RV4286=0 X-NAI-Spam-Version: 2.2.0.9309 : core <4286> : streams <788671> : uri <1171836> X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) X-Received-From: 140.186.70.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:62271 Archived-At: > A simple way of doing this goes along the following lines: > Lisp_Object enc_str1 = ENCODE_SYSTEM (string1); > Lisp_Object enc_str2 = ENCODE_SYSTEM (string2); > return make_number (strcoll (enc_str1, enc_str2)); That's probably OK for dired'd sorting but not for sort-subr where we need to be independent from the system locale. So better would be to switch the locale to utf-8 and call strcoll without calling ENCODE_SYSTEM (tho of course, only if the strings are multibyte). Stefan