From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 13976 invoked by alias); 20 Jul 2012 08:25:43 -0000 Received: (qmail 13393 invoked by uid 22791); 20 Jul 2012 08:25:10 -0000 X-Spam-Check-By: sourceware.org Received: from aquarius.hirmke.de (HELO calimero.vinschen.de) (217.91.18.234) by sourceware.org (qpsmtpd/0.83/v0.83-20-g38e4449) with ESMTP; Fri, 20 Jul 2012 08:24:55 +0000 Received: by calimero.vinschen.de (Postfix, from userid 500) id 924CC2C0074; Fri, 20 Jul 2012 10:24:52 +0200 (CEST) Date: Fri, 20 Jul 2012 08:25:00 -0000 From: Corinna Vinschen To: cygwin@cygwin.com Subject: Re: Internal echo of shell beaves (sometimes) different to external echo Message-ID: <20120720082452.GV31055@calimero.vinschen.de> Reply-To: cygwin@cygwin.com Mail-Followup-To: cygwin@cygwin.com References: <50086B4A.6090801@laposte.net> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner@cygwin.com Mail-Followup-To: cygwin@cygwin.com X-SW-Source: 2012-07/txt/msg00432.txt.bz2 On Jul 20 07:08, Ralf wrote: > Cyrille Lefevre laposte.net> writes: > > > > > Le 19/07/2012 16:51, Ralf a écrit : > > > Is there a way to get the right umlaut with the internal echo of the shell? > > > Example script: > > > > > > export LC_ALL=de_DE > > > > seems to default to iso8859-1 or something like that, let's try > > > > export LC_ALL=de_DE.UTF-8 > > > > which should work better... > > > > export LC_ALL=de_DE.UTF-8 gives following output: > > C:\>bash ttt.sh > CYGWIN_NT-6.0-WOW64 WIESWEG 1.7.15(0.260/5/3) 2012-05-09 10:25 i686 Cygwin > R▒cken > 0000000 R 374 c k e n \r \n > 0000010 > R▒cken > 0000000 R 374 c k e n \n > 0000007 > R▒cken > 0000000 R 374 c k e n \n > 0000007 What you don't seem to see is that the codeset doesn't play any role anymore *at this point in time*. You already created the string "Rücken" in ISO-8859-1 at the time you created the script and your script will diligently create the file ttt.txt with the word Rücken in ISO-8859-1, because that's how it's stored in the script. Thus, it doesn't matter what codeset you have set when running that script. Here's an idea for you to test: Replace echo "Rücken" > ttt.txt with read -p "Enter: " foo echo "$foo" > ttt.txt And then start your script with LANG set to, for instance, C.UTF-8, as is the default when running an interactive Cygwin shell like bash or tcsh. (though I would prefer to use POSIX paths rather than DOS paths: http://cygwin.com/cygwin-ug-net/using.html#using-pathnames) Corinna -- Corinna Vinschen Please, send mails regarding Cygwin to Cygwin Project Co-Leader cygwin AT cygwin DOT com Red Hat -- Problem reports: http://cygwin.com/problems.html FAQ: http://cygwin.com/faq/ Documentation: http://cygwin.com/docs.html Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple