From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 47847 invoked by alias); 26 Dec 2015 21:57:40 -0000 Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner@cygwin.com Mail-Followup-To: cygwin@cygwin.com Received: (qmail 47837 invoked by uid 89); 26 Dec 2015 21:57:39 -0000 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 Received: from edrusb.is-a-geek.org (HELO edrusb.is-a-geek.org) (82.231.235.144) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Sat, 26 Dec 2015 21:57:38 +0000 Date: Sat, 26 Dec 2015 21:57:00 -0000 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@cygwin.com Subject: Re: stat() lstat() not able to read long filename with cyrillic chars? References: <20151223194440.5B2A98CFEA@edrusb.is-a-geek.org> <20151224192448.GB4275@calimero.vinschen.de> <773876572.20151225030451@yandex.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 X-SW-Source: 2015-12/txt/msg00318.txt.bz2 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