delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2003/05/29/06:08:51

Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sources.redhat.com/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sources.redhat.com/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
From: "Hannu E K Nevalainen \(garbage mail\)" <garbage_collector AT telia DOT com>
To: "Luciano" <lucianoav AT gmx DOT net>, <cygwin AT cygwin DOT com>
Subject: RE: Lack of characters
Date: Thu, 29 May 2003 12:07:12 +0200
Message-ID: <NGBBLLIAMFLGJEOAJCCEOECKDAAA.garbage_collector@telia.com>
MIME-Version: 1.0
X-Priority: 3 (Normal)
X-MSMail-Priority: Normal
Importance: Normal
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
In-Reply-To: <Xns9389DD85534A7lucianoavgmxnet@80.91.224.249>

> From: cygwin-owner AT cygwin DOT com [mailto:cygwin-owner AT cygwin DOT com]On Behalf
> Of Luciano

> - I cannot paste accented characters into rxvt. They are replaced
> with weird symbols. I can type them and I can copy them, but I cannot
> paste them back;

 In other words; you cannot paste characters with the EIGHTH BIT set. This
is tightly associated with settings that has "meta" within their name (in
.inputrc) - you'll have to check the docs on those ($ info readline).
These:
	$ grep -i meta .inputrc
	set convert-meta off
	set input-meta on
	set output-meta on

has made my life easier... "convert-meta off" might create problems with
e.g. emacs and the like - as emacs uses meta as a "command introducer". (I
do not use emacs)

> - accented characters become question marks in filenames listed by
> 'ls'. The document 'Auto correção.doc' becomes 'Auto corre??o.doc.
>
> - if I use 'dir', it becomes 'Auto\ corre\347\343o.doc'';

> - if I pass the output of 'dir' to a file, I see the same problems,
> but if I pass the output of 'ls', everything changes! The accented
> characters are printed correctly, but the color codes are printed!
> See this sample line:
> 	-rw-r--r--    1 Luc      all        219986 May 28 15:27 Auto
> Correção.txt

NOTE: dir --help <==> ls --help
$ dir --help >D
$ ls --help >L
$ diff D L
1c1
< Usage: dir [OPTION]... [FILE]...
---
> Usage: ls [OPTION]... [FILE]...
$ md5sum `which ls`.exe; md5sum `which dir`.exe
cc4ac1f64fde23d79e147db501090cec */usr/bin/ls.exe
1e82062954af63192aefb5929c9e0e43 */usr/bin/dir.exe

dir is most likely a derivate of ls.

These lines in .profile will make your "dir" behave. Remove --color to get
rid of color codes in files. I use 'find' for creating filename lists, your
preferences seems to differ.
 --show-control-chars is what you need to remove "?" and \347 from
filenames.

# -----------------------
#  -- shell functions --
# -----------------------
ls () {
 command ls \
        --show-control-chars    \
        --color                 \
        --classify              \
        --no-group              \
         $@;
 }

# UNTESTED
dir () {
 command dir \
        --show-control-chars    \
        --color                 \
        --classify              \
        --no-group              \
         $@;
 }


> - cat file.txt displays the file's contents correctly, even if it
> contains accented characters;

 cat copies the file contents, ls/dir 'interprets' filename contents unless
you tell it it stop. I'd say that this is because of legacy (non-'8 bit'
terminals).

> - if I try to zip a file whose name contains accented characters with
> a shell extension program I use (PowerPro), I get an error message
> regarding some "Sharing/Network-protection error". If the file's name
> does not have any accented characters, it zips up fine.

 That is a problem of PowerPro, get in contact with the creator.

> - if I try to gzip a file whose name contains accented characters
> (with or without the shell extension program), it compresses without
> complaints,

> but accented characters become weird symbols inside the archive.

And? gzip compresses the content, the compressed data isn't readable(!?),
gunzip will recreate the content.

$ echo >'Auto correção.doc' "TEST"
$ tar -zcf TEST Auto\ correção.doc
$ ls -l
total 2685
... Auto correção.doc
...
$ tar -tf TEST
$ tar -ztf TEST
Auto corre\347\343o.doc

> Hannu offered me some kind help, but it has to do with typing into
> rxvt, and I don't have any problem with that.

 It really is about IO with the terminal (rxvt or whatever), and then you
have the fact that e.g. ls, dir, tar... do not obey
readline/.inputrc/.profile settings - unless you tell them so - or patch
them to do so.

> Like I said, I didn't
> have any problems with accented characters until last Saturday. I
> formatted and reinstalled Windows and now I have all these strange
> problems. Any help greatly and desperately appreciated.

 In the end this really isn't cygwin related... It is a general shell
settings topic. You might find other solutions than mine on/in any "bash"
mailing list or news group. (www.google.com)

/Hannu E K Nevalainen, Mariefred, Sweden, 59~14'N, 17~12'E. >17~C avg/d now.
~ <=> degree
--END OF MESSAGE--


--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019