From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Laimonas =?UTF-8?Q?V=C4=97bra?= Newsgroups: gmane.emacs.bugs Subject: bug#6546: win32 grep/shell utf-8 encoding Date: Fri, 23 Jul 2010 15:54:34 +0300 Message-ID: <4C49910A.2010209@gmail.com> References: <4C2C55ED.3020207@gmail.com> <4C485199.7020501@gmail.com> <4C488CCC.6080107@gmail.com> <83k4oncmyp.fsf@gnu.org> <4C48BCAC.6040101@gmail.com> <83zkxits1p.fsf@gnu.org> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Trace: dough.gmane.org 1279891250 30415 80.91.229.12 (23 Jul 2010 13:20:50 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Fri, 23 Jul 2010 13:20:50 +0000 (UTC) Cc: 6546@debbugs.gnu.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Fri Jul 23 15:20:47 2010 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1OcIB9-00085r-HL for geb-bug-gnu-emacs@m.gmane.org; Fri, 23 Jul 2010 15:20:43 +0200 Original-Received: from localhost ([127.0.0.1]:33404 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OcHyR-0004xp-IA for geb-bug-gnu-emacs@m.gmane.org; Fri, 23 Jul 2010 09:07:35 -0400 Original-Received: from [140.186.70.92] (port=38823 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OcHyK-0004xb-7R for bug-gnu-emacs@gnu.org; Fri, 23 Jul 2010 09:07:29 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1OcHyI-0008TB-Rd for bug-gnu-emacs@gnu.org; Fri, 23 Jul 2010 09:07:27 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:55576) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OcHyI-0008T6-Oc for bug-gnu-emacs@gnu.org; Fri, 23 Jul 2010 09:07:26 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.69) (envelope-from ) id 1OcHmJ-0003Uz-2o; Fri, 23 Jul 2010 08:55:03 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Laimonas =?UTF-8?Q?V=C4=97bra?= Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-To: owner@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 23 Jul 2010 12:55:03 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 6546 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 6546-submit@debbugs.gnu.org id=B6546.127988968413437 (code B ref 6546); Fri, 23 Jul 2010 12:55:03 +0000 Original-Received: (at 6546) by debbugs.gnu.org; 23 Jul 2010 12:54:44 +0000 Original-Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OcHly-0003Ug-Vu for submit@debbugs.gnu.org; Fri, 23 Jul 2010 08:54:43 -0400 Original-Received: from mail-ew0-f44.google.com ([209.85.215.44]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OcHlw-0003Ua-TD for 6546@debbugs.gnu.org; Fri, 23 Jul 2010 08:54:41 -0400 Original-Received: by ewy22 with SMTP id 22so69018ewy.3 for <6546@debbugs.gnu.org>; Fri, 23 Jul 2010 05:54:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from :user-agent:mime-version:to:cc:subject:references:in-reply-to :content-type:content-transfer-encoding; bh=jkgisT3MGCljWC7QyIq12uWP8vpERqLuQ+qupLUB/i0=; b=ILg2x/Sq7hIyj/Z0q9eBP1zsTgtq5E9rf+IjX0HTEwu1ByAjk8XgfiyZPGxRs2S8Tx gnC3ITL/Y/92DxW1fLZ/eWPUgm8cssG8us8j7KUk510TVBTznAc5VKnvvipmE9fZr6EL HVGTIuZ2+on7XaO7xeUNtH2WoxdDdYtt8inPA= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:user-agent:mime-version:to:cc:subject :references:in-reply-to:content-type:content-transfer-encoding; b=TdDscDBGoL6RXfFly8OB37v2QFvDUITFB9YfwHU+qf1CWoSXEcbwZ/bPzZd+S1wJXf CY70Ebhhlmw+IqSsgXIL6qANEcxgOjgpusQxfeGQ2MZb+0O7gJfBwBrnQmuY4A4cjY4B +Nywi3KVP8Mgkbgw41DouRursrQpuehFmu31c= Original-Received: by 10.213.15.197 with SMTP id l5mr529632eba.95.1279889677870; Fri, 23 Jul 2010 05:54:37 -0700 (PDT) Original-Received: from [192.168.2.2] (lan-84-240-35-136.vln.skynet.lt [84.240.35.136]) by mx.google.com with ESMTPS id a48sm346592eei.1.2010.07.23.05.54.37 (version=TLSv1/SSLv3 cipher=RC4-MD5); Fri, 23 Jul 2010 05:54:37 -0700 (PDT) User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.1.11) Gecko/20100701 SeaMonkey/2.0.6 In-Reply-To: <83zkxits1p.fsf@gnu.org> X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list Resent-Date: Fri, 23 Jul 2010 08:55:03 -0400 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) 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: , Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:38818 Archived-At: Eli Zaretskii wrote: >> Date: Fri, 23 Jul 2010 00:48:28 +0300 >> From: Laimonas Vėbra >> CC: 6546@debbugs.gnu.org >> >>> Did you try to add a suitably-valued LANG variable to >>> process-environment? That would at least force Cygwin executables to >>> work in the Windows codepage. >> >> The only way it works is when i set LANG process-environment variable to >> the current windows locale codepage and 'coding-system-for-write' to the >> encoding/charset in which i'd like to grep. > > That's the only way it's _supposed_ to work. Then i suppose it's wrong/incorrect way of what is supposed to operate like that. Why? Because for the correct behaviour we (external app, Emacs) shouldn't require to set locale to some fixed setting; it should be freely changed as many cygwin apps relies on that. For example, how do you sort data with improper locale settings (which are required to be fixed)? Will seek for another workaround? Example: echo -e "-ĔĿİ-\n_ĔĿİ_\nELI\nĔĿİ" > file.txt $ export LANG=lt_LT.cp1257 $ cat file.txt -Ä”ÄæÄ°- _Ä”ÄæÄ°_ ELI Ä”ÄæÄ° $ cat file.txt | sort _Ä”ÄæÄ°_ Ä”ÄæÄ° -Ä”ÄæÄ°- ELI $ export LANG=lt_LT.utf-8 $ cat file.txt -ĔĿİ- _ĔĿİ_ ELI ĔĿİ $ cat file.txt | sort _ĔĿİ_ ELI ĔĿİ -ĔĿİ- > Yes, this is the only setup that is supposed to work. Maybe it is/was suppose to work (at all) like that in the sense of workaround, but i doubt if it was/is supposed to be correct.