From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wm1-x332.google.com (mail-wm1-x332.google.com [IPv6:2a00:1450:4864:20::332]) by sourceware.org (Postfix) with ESMTPS id 1A4C83857831 for ; Mon, 17 May 2021 06:28:39 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 1A4C83857831 Received: by mail-wm1-x332.google.com with SMTP id u4-20020a05600c00c4b02901774b80945cso996708wmm.3 for ; Sun, 16 May 2021 23:28:39 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=nWmn2m4wQReeZ8xbKytgFxaesbmiQbB08f2BHVWlz0Q=; b=qgHmQXQXS2KKO+z45HgBjOs/H9B1tp5C9IirNNkp2z0Ji0P/RIT8qZf2u/XPNvnCkK WTvxtxKHsigp0B7qzHQXQW8Xc5eg8eN6yqfmvlP+FkYxxdhEiZ0/ULPWs736dxqWqzil R5Jtn2+0ihFIqgkOnV/ULcYYuR2adliXF2USMbWvtfjPZdXslpaXqe3mF2SVdQF9iD/K znYsVP2cItDxqaMrk8gkZw681eS8KW1MY8tP2JxmUp+yFc8/At4s2aRVUhpv7YtQw2NM /vMvFtgmDVYdp0Xq4hCEQALmWnnhS/HLQfBrQOJi7DM9TSr1RdBZ77xt1HRtH+ZziuMY huvA== X-Gm-Message-State: AOAM530YcitOYZgmsYoQsUJN96ku0RfTSRCk+95h64asMYJTFtZJ1Jfh UZiiluNlCroz31Q7MLVjEUeiakYSUOc= X-Google-Smtp-Source: ABdhPJwJZOkQJwI92csgiwUP5g70uKIHlrNq1l748JCp/iObtXQyb6Z0HOOJj0qpSqvlF1LhOU2lTQ== X-Received: by 2002:a1c:2743:: with SMTP id n64mr21045313wmn.76.1621232917853; Sun, 16 May 2021 23:28:37 -0700 (PDT) Received: from ?IPv6:2003:cc:9f04:e3c0:7957:2b91:a4a2:cebe? (p200300cc9f04e3c079572b91a4a2cebe.dip0.t-ipconnect.de. [2003:cc:9f04:e3c0:7957:2b91:a4a2:cebe]) by smtp.gmail.com with ESMTPSA id r5sm15347079wmh.23.2021.05.16.23.28.37 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sun, 16 May 2021 23:28:37 -0700 (PDT) Subject: Re: pdfgrep [ITA] To: cygwin-apps@cygwin.com References: <000401d7404f$faa32970$efe97c50$@pdinc.us> <877dkf7hep.fsf@Rainer.invalid> <001001d74052$710751c0$5315f540$@pdinc.us> <017801d74500$4c5eb270$e51c1750$@pdinc.us> <4003269c-9c8b-7707-d3a8-8f6f5c2cd333@gmail.com> <057f01d74ad9$98ee6d40$cacb47c0$@pdinc.us> From: Marco Atzeri Message-ID: <61bdb462-4d6b-7495-1d7c-4435a42a03b2@gmail.com> Date: Mon, 17 May 2021 08:28:34 +0200 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.10.1 MIME-Version: 1.0 In-Reply-To: <057f01d74ad9$98ee6d40$cacb47c0$@pdinc.us> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: it Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-1.6 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, NICE_REPLY_A, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: cygwin-apps@cygwin.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Cygwin package maintainer discussion list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 17 May 2021 06:28:40 -0000 On 17.05.2021 07:00, Jason Pyeron wrote: >> -----Original Message----- >> From: Marco Atzeri >> Sent: Sunday, May 9, 2021 4:05 PM >> >> On 09.05.2021 21:54, Marco Atzeri wrote: >>> On 09.05.2021 20:22, Jason Pyeron wrote: >>> >> >>> >>> $ ./pdfgrep.exe --help >>> terminate called after throwing an instance of 'std::runtime_error' >>> what(): locale::facet::_S_create_c_locale name not valid >>> Aborted (core dumped) >>> >>> Same for your binary >>> >> >> it seems the program does not like a locale different from C >> >> $ LC_ALL=C bin/pdfgrep.exe >> Usage: bin/pdfgrep [OPTION]... PATTERN FILE... >> >> See 'bin/pdfgrep --help' for more information >> >> $ LC_ALL="en_US.UTF-8" bin/pdfgrep.exe >> terminate called after throwing an instance of 'std::runtime_error' >> what(): locale::facet::_S_create_c_locale name not valid >> Aborted (core dumped) > > Tracking upstream at: https://gitlab.com/pdfgrep/pdfgrep/-/issues/50 > > Bug introduced between v1.4.1 and v2.0 in commit 3eb727125f119e1fbc19ba67449838c3f91cd9f6 > Author: Hans-Peter Deifel > Date: Tue Jun 21 16:56:30 2016 +0200 > > Set locale to user preferred one > > This enables some unicode awareness in regcomp/regexec if the user has > set a UTF-8 loacle. > > > Specifically the change was the addition of: > > locale::global(locale("")); > also the simple example on https://en.cppreference.com/w/cpp/locale/locale $ cat test-locale.cpp #include #include int main() { std::wcout << "User-preferred locale setting is " << std::locale("").name().c_str() << '\n'; // on startup, the global locale is the "C" locale std::wcout << 1000.01 << '\n'; // replace the C++ global locale as well as the C locale with the user-preferred locale std::locale::global(std::locale("")); // use the new global locale for future wide character output std::wcout.imbue(std::locale()); // output the same number again std::wcout << 1000.01 << '\n'; } ./test-locale.exe terminate called after throwing an instance of 'std::runtime_error' what(): locale::facet::_S_create_c_locale name not valid Aborted (core dumped) so or the standard is changed or Cygwin implementation has an issue Regards Marco