This is the mail archive of the cygwin@cygwin.com mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

RE: Lack of characters


> From: cygwin-owner@cygwin.com [mailto:cygwin-owner@cygwin.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/


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]