delorie.com/archives/browse.cgi | search |
X-Recipient: | archive-cygwin AT delorie DOT com |
X-Spam-Check-By: | sourceware.org |
Date: | Fri, 20 Jul 2012 10:24:52 +0200 |
From: | Corinna Vinschen <corinna-cygwin AT cygwin DOT com> |
To: | cygwin AT cygwin DOT com |
Subject: | Re: Internal echo of shell beaves (sometimes) different to external echo |
Message-ID: | <20120720082452.GV31055@calimero.vinschen.de> |
Reply-To: | cygwin AT cygwin DOT com |
Mail-Followup-To: | cygwin AT cygwin DOT com |
References: | <loom DOT 20120719T162931-952 AT post DOT gmane DOT org> <50086B4A DOT 6090801 AT laposte DOT net> <loom DOT 20120720T084207-511 AT post DOT gmane DOT org> |
MIME-Version: | 1.0 |
In-Reply-To: | <loom.20120720T084207-511@post.gmane.org> |
User-Agent: | Mutt/1.5.21 (2010-09-15) |
Mailing-List: | contact cygwin-help AT cygwin DOT com; run by ezmlm |
List-Id: | <cygwin.cygwin.com> |
List-Unsubscribe: | <mailto:cygwin-unsubscribe-archive-cygwin=delorie DOT com AT cygwin DOT com> |
List-Subscribe: | <mailto:cygwin-subscribe AT cygwin DOT com> |
List-Archive: | <http://sourceware.org/ml/cygwin/> |
List-Post: | <mailto:cygwin AT cygwin DOT com> |
List-Help: | <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs> |
Sender: | cygwin-owner AT cygwin DOT com |
Mail-Followup-To: | cygwin AT cygwin DOT com |
Delivered-To: | mailing list cygwin AT cygwin DOT com |
On Jul 20 07:08, Ralf wrote: > Cyrille Lefevre <cyrille.lefevre-lists <at> 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
webmaster | delorie software privacy |
Copyright © 2019 by DJ Delorie | Updated Jul 2019 |