From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 8566 invoked by alias); 3 Jul 2002 10:30:24 -0000 Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner@cygwin.com Mail-Followup-To: cygwin@cygwin.com Received: (qmail 8524 invoked from network); 3 Jul 2002 10:30:21 -0000 Received: from unknown (HELO mail3.svr.pol.co.uk) (195.92.193.19) by sources.redhat.com with SMTP; 3 Jul 2002 10:30:21 -0000 Received: from modem-3911.cheetah.dialup.pol.co.uk ([217.134.111.71] helo=avacado.atomice.net) by mail3.svr.pol.co.uk with esmtp (Exim 3.35 #1) id 17PhOt-0000o5-00; Wed, 03 Jul 2002 11:30:20 +0100 Received: from advent02 [192.168.0.1] (chris@atomice.net); Wed, 3 Jul 2002 11:30:19 +0100 X-WM-Posted-At: avacado.atomice.net; Wed, 3 Jul 02 11:30:19 +0100 Message-ID: <008c01c2227c$a10a96b0$0100a8c0@advent02> From: "Chris January" To: "Ville Herva" Cc: 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, 03 Jul 2002 03:38:00 -0000 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 X-SW-Source: 2002-07/txt/msg00216.txt.bz2 > > 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 > "\\.\" 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/