New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
open ':locale' does not work under locale with the modifier #9185
Comments
From kmashrab@uni-bremen.deI have Perl v5.8.8. My locale is Uzbek (cyrillic), which is a standard libc When I use the Perl command "use open ':locale'" I get the following error Cannot find encoding "UTF-8@cyrillic" at /usr/lib/perl5/5.8.7/open.pm line |
From kmashrab@uni-bremen.deCreated by kmashrab@uni-bremen.deI have Perl v5.8.8. My locale is Uzbek (cyrillic), which is a standard libc When I use the Perl command "use open ':locale'" I get the following error Cannot find encoding "UTF-8@cyrillic" at /usr/lib/perl5/5.8.7/open.pm line Perl Info
|
From @rgsOn 11/01/2008, via RT Mashrab Kuvatov <perlbug-followup@perl.org> wrote:
|
The RT System itself - Status changed from 'new' to 'open' |
From @rgsOn 11/01/2008, via RT Mashrab Kuvatov <perlbug-followup@perl.org> wrote:
Trimmed down to: $ bleadperl -wle 'binmode STDIN,q(:encoding(UTF-8@cyrillic))' open.pm should probably ignore whatever is after the @. However I'd |
From kmashrab@uni-bremen.deLook at the following document, "3.4 Locale environment variables", for the http://www.linuxdocs.org/HOWTOs/Unicode-HOWTO-3.html There are quite few locales with the modifier. Look at the libc sources. http://sourceware.org/cgi-bin/cvsweb.cgi/libc/localedata/locales/?cvsroot=glibc Mashrab. |
From @rgsOn 11/01/2008, Mashrab Kuvatov <kmashrab@uni-bremen.de> wrote:
OK. I found the bug, in encoding.pm, and fixed it with the appended patch. However encoding.pm first tries I18N::Langinfo to figure out the perl -MI18N::Langinfo=langinfo,CODESET -le 'print langinfo(CODESET())' And I18N::Langinfo is a direct wrapper around the glibc function nl_langinfo(3). The patch is: Change 32977 by rgs@scipion on 2008/01/14 22:48:46 When parsing LC_ALL or LANG to get the locale's encoding, ignore Affected files ... ... //depot/perl/ext/Encode/encoding.pm#48 edit Differences ... ==== //depot/perl/ext/Encode/encoding.pm#48 (text) ==== @@ -1,6 +1,6 @@ use Encode; if ( not $locale_encoding && in_locale() ) { |
The RT System itself - Status changed from 'new' to 'open' |
From kmashrab@uni-bremen.deOn Monday 14 January 2008 23:53, Rafael Garcia-Suarez wrote:
UTF-8 Mashrab. |
From @rgsOn 15/01/2008, Mashrab Kuvatov <kmashrab@uni-bremen.de> wrote:
Good catch ! Yes, you're right, and I've fixed encoding.pm accordingly. Change 32980 by rgs@stcosmo on 2008/01/15 14:23:04 Boolean priority bug, found by Mashrab Kuvatov: Affected files ... ... //depot/perl/ext/Encode/encoding.pm#49 edit Differences ... ==== //depot/perl/ext/Encode/encoding.pm#49 (text) ==== @@ -50,7 +50,7 @@ no warnings 'uninitialized'; - if ( not $locale_encoding && in_locale() ) { |
From kmashrab@uni-bremen.deI tried the patch proposed by Rafael Garcia-Suarez. It fixes the issue I I think that in addition to Rafael's fix one has to fix the following logic in if ( not $locale_encoding && in_locale() ) { I tried to print out $locale_encoding and in_locale() in LANG and LC_ALL set if ( ( not $locale_encoding ) && in_locale() ) { Actually, I do not understand how in_locale() works. However, my experiment Mashrab. |
From @druud62Mashrab Kuvatov wrote:
Well, that's what you get when you mix the higher && lower precedence I would choose one of these: if ( !$locale_encoding && in_locale() ) { if ( not $locale_encoding and in_locale() ) { -- "Gewoon is een tijger." |
From @TuxOn Tue, 15 Jan 2008 20:43:29 +0100, "Dr.Ruud" <rvtol+news@isolution.nl> wrote:
I would choose if (!$locale_encoding and in_locale ()) { your last option does not increase legibility. The first is OK with me -- |
p5p@spam.wizbit.be - Status changed from 'open' to 'resolved' |
Migrated from rt.perl.org#49646 (status was 'resolved')
Searchable as RT49646$
The text was updated successfully, but these errors were encountered: