X-Recipient: archive-cygwin@delorie.com
DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 2D397385770B
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cygwin.com;
	s=default; t=1681739253;
	bh=1jmmFr9K2UOvHZQGwVa4WijYHw6WOrAFf8N3M3AUcUU=;
	h=Date:To:Cc:Subject:In-Reply-To:References:List-Id:
	 List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe:
	 From:Reply-To:From;
	b=Mcs4wL58nA5hBrNZEM1lzYs0Gk4RE3KkE0u/md2znaQ5Umaja9uGG20jh1dkDh/xn
	 zv3pw/FJskj0IWPi/KmpXIP1pbvqCBfvXBr4eDK3vU47lu6CpCWG4QnzQslmrLJxk/
	 1xONC0DGgu93VasQihXKFa0CKpnidNxkuH3Ibz7Y=
X-Original-To: cygwin@cygwin.com
Delivered-To: cygwin@cygwin.com
DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 74AC33858C2C
MIME-Version: 1.0
Date: Mon, 17 Apr 2023 15:46:52 +0200
To: cygwin@cygwin.com
Cc: Corinna Vinschen <corinna-cygwin@cygwin.com>
Subject: Re: Can not stat file with utf char U+F020
In-Reply-To: <ZD0L5VoqmTHmHBT9@calimero.vinschen.de>
References: <992b3c28d7f1cfc17f7c9bb47b53f770@assyoma.it>
 <ZDmiyYS+m0x4QZmh@calimero.vinschen.de>
 <f4d0bd30-731a-fb5e-43d2-a86d1af761b6@Shaw.ca>
 <dfbdeec869acd6ed1ad7b4ec803336f2@assyoma.it>
 <ZDm20Rug7TswU4KI@calimero.vinschen.de>
 <1274a3199d9bedab4f15d209694c6e1f@assyoma.it>
 <de19dc1ecd891f748e5e4a317f347477@assyoma.it>
 <ZD0L5VoqmTHmHBT9@calimero.vinschen.de>
Message-ID: <fc6d3aa5f3ae525a777e65d62ccbd6c2@assyoma.it>
X-Sender: g.danti@assyoma.it
X-Spam-Status: No, score=-1.4 required=5.0 tests=BAYES_00, KAM_DMARC_STATUS,
 KAM_NUMSUBJECT, SPF_HELO_NONE, SPF_PASS,
 T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.6
X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on
 server2.sourceware.org
X-BeenThere: cygwin@cygwin.com
X-Mailman-Version: 2.1.29
Precedence: list
List-Id: General Cygwin discussions and problem reports <cygwin.cygwin.com>
List-Unsubscribe: <https://cygwin.com/mailman/options/cygwin>,
 <mailto:cygwin-request@cygwin.com?subject=unsubscribe>
List-Archive: <https://cygwin.com/pipermail/cygwin/>
List-Post: <mailto:cygwin@cygwin.com>
List-Help: <mailto:cygwin-request@cygwin.com?subject=help>
List-Subscribe: <https://cygwin.com/mailman/listinfo/cygwin>,
 <mailto:cygwin-request@cygwin.com?subject=subscribe>
From: Gionatan Danti via Cygwin <cygwin@cygwin.com>
Reply-To: Gionatan Danti <g.danti@assyoma.it>
Content-Transfer-Encoding: 7bit
Content-Type: text/plain; charset="us-ascii"; Format="flowed"
Errors-To: cygwin-bounces+archive-cygwin=delorie.com@cygwin.com
Sender: "Cygwin" <cygwin-bounces+archive-cygwin=delorie.com@cygwin.com>

Il 2023-04-17 11:05 Corinna Vinschen ha scritto:
> It's actually not the "dos" mount option but specific filesystems
> which trigger the conversion from U+0020 to U+F020.

OK.

> However, the conversion back is handled in a piece of code which has
> no information about the underlying filesystem, so the F0xx -> 00xx
> conversion is done all the time.  Adding filesystem info in this
> place is really tricky.

Ah, I missed it, thanks! With these new information, I did some 
progress.

First, I use the "dos" mount option to always trigger conversion of 
space and dot at filename end into F+00xx chars. Now I am able to create 
such strange-looking file (in Explorer) within cygwin itself. For 
example, touch "zzs " now results in "zzs+strangechar" in Explorer. Both 
cygwin and windows are able to read/write such file.

But if I edit the filename via Explorer adding an extension (ie: from 
"zzs+strangechar" to "zzs+strangechar.txt") now cygwin is suddenly 
unable to read/write the file.

It seems to me that the appended chars prevent cygwin to translate back 
F0xx to 00xx (as the PUA char is not at the end of the filename 
anymore).

So, two paths should be available:
- always translate back F0xx to 00xx even if not at the end of filename;
- otherwise, if too invasive to do it unconditionally, add an option as 
"always_translate_pua" (default: off) to enable such behavior based on 
user needs.

I would (naively?) think that option 1 (always translate back PUA) 
should be the preferred approach, as cygwin is at the moment effectively 
unable to access some files.

Regards.

-- 
Danti Gionatan
Supporto Tecnico
Assyoma S.r.l. - www.assyoma.it
email: g.danti@assyoma.it - info@assyoma.it
GPG public key ID: FF5F32A8

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