X-Recipient: archive-cygwin AT delorie DOT com DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:date:from:mime-version:to:subject:references :in-reply-to:content-type:content-transfer-encoding:message-id; q=dns; s=default; b=pfs2BGvKyxdfM7b+gkDHT7yoSOROPS7dsGqQTEY6FEd zK63DRF2lN2owxnjKuUWg4HqNvy7+VLM/o1MQKz1Uvbyxk1jx2Ua6oqGVQ0SwpQ3 1GUc0px2waXqzetSf9rL+OO6VqbHPuNbuEml6z8/9eYfKnvggwQqFSGdMP2k80AA = DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:date:from:mime-version:to:subject:references :in-reply-to:content-type:content-transfer-encoding:message-id; s=default; bh=ufxzXw9ujMqHPPtZCwthLN5TkUk=; b=J3B/Vvv9vztqg/P3G WlS81E2aASaIoCbCgYuioGHDkFAeoZj6ILyw99vMRW81IJoGgcfOf6kXkFCecqsk 7mvAdIERlb5SFN7O6wA/l/1Sjpz5ilkEMDMdxt5CCR1CINeD9ocDMfaEV/gFjhW8 gafIrzr4GsswHYMBx5+SKyy67I= Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com Delivered-To: mailing list cygwin AT cygwin DOT com Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=3.4 required=5.0 tests=AWL,BAYES_50,FREEMAIL_FROM,KAM_LAZY_DOMAIN_SECURITY autolearn=no version=3.3.2 spammy=Greetings, namely, lstat, filenames X-HELO: edrusb.is-a-geek.org Date: Sat, 26 Dec 2015 22:57:21 +0100 From: Denis Corbin User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:10.0.12) Gecko/20130119 Icedove/10.0.12 MIME-Version: 1.0 To: cygwin AT cygwin DOT com Subject: Re: stat() lstat() not able to read long filename with cyrillic chars? References: <20151223194440 DOT 5B2A98CFEA AT edrusb DOT is-a-geek DOT org> <20151224192448 DOT GB4275 AT calimero DOT vinschen DOT de> <773876572 DOT 20151225030451 AT yandex DOT ru> In-Reply-To: <773876572.20151225030451@yandex.ru> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Message-Id: <20151226215732.3196F8B96F@edrusb.is-a-geek.org> X-IsSubscribed: yes On 25/12/2015 01:04, Andrey Repin wrote: > Greetings, Corinna Vinschen! > >>> First, I have read the FAQ and this mailing archive :) >>> [..] > >> NAME_MAX is 255. On Windows this is the number of UTF-16 chars >> unfortunately. On POSIX systems (as on Cygwin) this is the >> number of bytes. Long UTF-16 strings in cyrillic take twice as >> much UTF-8 chars as it has UTF-16 chars, so NAME_MAX in utf-8 >> cyrillics translates into a maximum of 127 UTF-16 chars. Ok, I understand. Thanks for your explanation. > > Aren't POSIX restrictions are a bit different? Namely 128 bytes > per path element and 4096 bytes for file name? Seen the sample file name it seems truncated rather near 256 bytes (~ 128 UTF-16 chars) than 4096 bytes... > >> If you need access to UTF-16 filenames with more characters, you >> can switch to a one-byte charset temporarily, e.g. > >> $ LC_ALL=ru_RU your_app > >> to switch to iso-8859-5 or > >> $ LC_ALL=ru_RU.CP1251 > >> to switch to Windows codepage 1251. See >> https://cygwin.com/cygwin-ug-net/setup-locale.html > > >> HTH, Corinna > > > -- Problem reports: http://cygwin.com/problems.html FAQ: http://cygwin.com/faq/ Documentation: http://cygwin.com/docs.html Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple