Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe@cygwin.com>
List-Archive: <http://sources.redhat.com/ml/cygwin/>
List-Post: <mailto:cygwin@cygwin.com>
List-Help: <mailto:cygwin-help@cygwin.com>, <http://sources.redhat.com/ml/#faqs>
Sender: cygwin-owner@cygwin.com
Mail-Followup-To: cygwin@cygwin.com
Delivered-To: mailing list cygwin@cygwin.com
X-WM-Posted-At: avacado.atomice.net; Wed, 3 Jul 02 11:30:19 +0100
Message-ID: <008c01c2227c$a10a96b0$0100a8c0@advent02>
From: "Chris January" <chris@atomice.net>
To: "Ville Herva" <vherva@niksula.hut.fi>
Cc: <cygwin@cygwin.com>
References: <20020701085851.GD9092@niksula.cs.hut.fi> <20020702213825.GF9092@niksula.cs.hut.fi> <01f801c22212$7d0cecf0$0100a8c0@advent02> <20020703093837.GI9092@niksula.cs.hut.fi> <004e01c22278$346ec610$0100a8c0@advent02> <20020703101822.GJ9092@niksula.cs.hut.fi>
Subject: Re: Accessing filenames with different charsets
Date: Wed, 3 Jul 2002 11:30:19 +0100
MIME-Version: 1.0
Content-Type: text/plain;
	charset="iso-8859-1"
Content-Transfer-Encoding: 7bit
X-Priority: 3
X-MSMail-Priority: Normal
X-MIMEOLE: Produced By Microsoft MimeOLE V6.00.2600.0000

> > I wrote a patch for Cygwin yesterday that converts Unicode filenames to
UTF8
> > and back for some file operations.
>
> Nice!
>
> > This should do what you want and allow you to restore the names
correctly
> > later. I will post it to cygwin-patches sometime today, but I'm not sure
> > whether the patch will appear in a Cygwin snapshot anytime soon, if not
I
> > can send you the modified binary and the patch directly for you to try.
> > The only disadvantage with this method is it still makes the filenames
> > impossible to type. However, if you have your terminal set up correctly,
> > it is certainly possible to read them as they should be (e.g. in xterm
> > with UTF8 support turned on). If you are using a graphical file browser
> > like konqueror then that makes things even easier.
>
> Yes, UTF8 approach is propably preferable in all ways. As for typing, I
> imagine you can get the 8.3 name with
>
>   for i in *; do echo $i: `cygpath -w -s $i`; done
>
> so you'll be able to type some name for the file as well.
>
> I'm really glad to see this fixed.
>
> What about filenames longer than MAX_PATH? Those can only be accessed with
> "\\.\<path>" and unicode file functions...
Since most programs internally allocate a buffer of size MAX_PATH or
PATH_MAX, they won't have enough room to store the full filename. Tt would
certainly be possible to support this if a system call was made with a long
filename, but that would mean replacing all statically allocated path
buffers (e.g. char buf[MAX_PATH]) with alloca (e.g. char *buf = alloca
(strlen(inbuf) + margin)) which is more than trivial.

Chris



--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Bug reporting:         http://cygwin.com/bugs.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

