Skip Menu |
Report information
Id: 133093
Status: open
Priority: 0/
Queue: perl5

Owner: Nobody
Requestors: martin [at] senfdax.de
Cc:
AdminCc:

Operating System: (no value)
PatchStatus: (no value)
Severity: low
Type: library
Perl Version: 5.26.0
Fixed In: (no value)



To: perlbug [...] perl.org, Martin Barth <martin [...] senfdax.de>
Date: Mon, 9 Apr 2018 09:23:40 +0200
From: Martin Barth <martin [...] senfdax.de>
Subject: I18N::LangTags::List name failes for az-*
Download (untitled) / with headers
text/plain 5.5k
This is a bug report for perl from martin@senfdax.de, generated with the help of perlbug 1.40 running under perl 5.26.0. ----------------------------------------------------------------- I think that the sub name does not respond corret to 'az-Latn', 'az-Arab' and 'az-Cyrl'. The results returns the "subform fallback" because the string 'az-Arab' in the POD contains a uppercase char while sub name() invokes lc() on $_[0] Show quoted text
> perl -E 'use I18N::LangTags::List; $I18N::LangTags::List::Debug = 1;
say I18N::LangTags::List::name("az-Latn")' Input: {az-latn} Shaving off: -latn leaving az Output: {Azerbaijani}{-latn} Azerbaijani (Subform "latn") [Please do not change anything below this line] ----------------------------------------------------------------- --- Flags:     category=library     severity=low     module=I18N::LangTags --- Site configuration information for perl 5.26.0: Configured by martin at Wed May 31 13:14:31 CEST 2017. Summary of my perl5 (revision 5 version 26 subversion 0) configuration:   Platform:     osname=linux     osvers=4.4.0-78-generic     archname=x86_64-linux-multi     uname='linux psyche 4.4.0-78-generic #99-ubuntu smp thu apr 27 15:29:09 utc 2017 x86_64 x86_64 x86_64 gnulinux '     config_args='-de -Dprefix=/home/martin/perl5/perlbrew/perls/perl-5.26.0 -Duseshrplib -Dusemultiplicity -Aeval:scriptdir=/home/martin/perl5/perlbrew/perls/perl-5.26.0/bin'     hint=recommended     useposix=true     d_sigaction=define     useithreads=undef     usemultiplicity=define     use64bitint=define     use64bitall=define     uselongdouble=undef     usemymalloc=n     default_inc_excludes_dot=define     bincompat5005=undef   Compiler:     cc='cc'     ccflags ='-fwrapv -fno-strict-aliasing -pipe -fstack-protector-strong -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64'     optimize='-O2'     cppflags='-fwrapv -fno-strict-aliasing -pipe -fstack-protector-strong -I/usr/local/include'     ccversion=''     gccversion='5.4.0 20160609'     gccosandvers=''     intsize=4     longsize=8     ptrsize=8     doublesize=8     byteorder=12345678     doublekind=3     d_longlong=define     longlongsize=8     d_longdbl=define     longdblsize=16     longdblkind=3     ivtype='long'     ivsize=8     nvtype='double'     nvsize=8     Off_t='off_t'     lseeksize=8     alignbytes=8     prototype=define   Linker and Libraries:     ld='cc'     ldflags =' -fstack-protector-strong -L/usr/local/lib'     libpth=/usr/local/lib /usr/lib/gcc/x86_64-linux-gnu/5/include-fixed /usr/include/x86_64-linux-gnu /usr/lib /lib/x86_64-linux-gnu /lib/../lib /usr/lib/x86_64-linux-gnu /usr/lib/../lib /lib     libs=-lpthread -lnsl -ldl -lm -lcrypt -lutil -lc     perllibs=-lpthread -lnsl -ldl -lm -lcrypt -lutil -lc     libc=libc-2.23.so     so=so     useshrplib=true     libperl=libperl.so     gnulibc_version='2.23'   Dynamic Linking:     dlsrc=dl_dlopen.xs     dlext=so     d_dlsymun=undef     ccdlflags='-Wl,-E -Wl,-rpath,/home/martin/perl5/perlbrew/perls/perl-5.26.0/lib/5.26.0/x86_64-linux-multi/CORE'     cccdlflags='-fPIC'     lddlflags='-shared -O2 -L/usr/local/lib -fstack-protector-strong' Locally applied patches:     Devel::PatchPerl 1.38 --- @INC for perl 5.26.0:     /home/martin/.workspace/e2l/base/lib     /home/martin/.workspace/e2l/sta/lib     /home/martin/.workspace/e2l/agent/lib     /home/martin/.workspace/e2l/tls/lib     /home/martin/.workspace/e2l/lib     /home/martin/.workspace/e2l/webapps/webadmin/lib     /home/martin/.workspace/e2l/webapps/statusweb/lib     /home/martin/.workspace/e2l/webapps/restapi/lib     /home/martin/.workspace/e2l/portal/dzbank/lib /home/martin/perl5/perlbrew/perls/perl-5.26.0/lib/site_perl/5.26.0/x86_64-linux-multi /home/martin/perl5/perlbrew/perls/perl-5.26.0/lib/site_perl/5.26.0 /home/martin/perl5/perlbrew/perls/perl-5.26.0/lib/5.26.0/x86_64-linux-multi     /home/martin/perl5/perlbrew/perls/perl-5.26.0/lib/5.26.0 --- Environment for perl 5.26.0:     HOME=/home/martin     LANG=de_DE.UTF-8     LANGUAGE=de_DE     LC_CTYPE=de_DE.UTF-8     LD_LIBRARY_PATH (unset)     LOGDIR (unset) PATH=/home/martin/perl5/perlbrew/bin:/home/martin/perl5/perlbrew/perls/perl-5.26.0/bin:/usr/lib/go-1.9/bin/go:/home/martin/.rakudobrew/moar-2017.09/install/share/perl6/site/bin:/home/martin/.rakudobrew/bin:/opt/bin:/home/martin/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:/home/martin/bin/:/opt/splunk/bin:/opt/netsnmp/bin:/opt/idea-IC-139.225.3/bin:/opt/gradle/gradle-2.2.1/bin:.:/home/martin/bin/android-sdk-linux/platform-tools PERL5LIB=/home/martin/.workspace/e2l/base/lib:/home/martin/.workspace/e2l/sta/lib:/home/martin/.workspace/e2l/agent/lib:/home/martin/.workspace/e2l/tls/lib:/home/martin/.workspace/e2l/lib:/home/martin/.workspace/e2l/webapps/webadmin/lib:/home/martin/.workspace/e2l/webapps/statusweb/lib:/home/martin/.workspace/e2l/webapps/restapi/lib:/home/martin/.workspace/e2l/portal/dzbank/lib     PERLBREW_BASHRC_VERSION=0.76     PERLBREW_HOME=/home/martin/.perlbrew PERLBREW_MANPATH=/home/martin/perl5/perlbrew/perls/perl-5.26.0/man PERLBREW_PATH=/home/martin/perl5/perlbrew/bin:/home/martin/perl5/perlbrew/perls/perl-5.26.0/bin     PERLBREW_PERL=perl-5.26.0     PERLBREW_ROOT=/home/martin/perl5/perlbrew     PERLBREW_VERSION=0.76     PERL_BADLANG (unset)     SHELL=/bin/zsh
RT-Send-CC: perl5-porters [...] perl.org
Download (untitled) / with headers
text/plain 1.7k
On Mon, 09 Apr 2018 08:37:39 GMT, martin@senfdax.de wrote: Show quoted text
> This is a bug report for perl from martin@senfdax.de, > generated with the help of perlbug 1.40 running under perl 5.26.0. > > > ----------------------------------------------------------------- > I think that the sub name does not respond corret to 'az-Latn', > 'az-Arab' and 'az-Cyrl'. The results returns the "subform fallback" > because the string 'az-Arab' in the POD contains a uppercase char > while > sub name() invokes lc() on $_[0] >
> > perl -E 'use I18N::LangTags::List; $I18N::LangTags::List::Debug = 1;
> say I18N::LangTags::List::name("az-Latn")' > Input: {az-latn} > Shaving off: -latn leaving az > Output: {Azerbaijani}{-latn} > Azerbaijani (Subform "latn") >
I believe that this is at most a minor documentation flaw. 'perldoc I18N::LangTags::List' specifically states: ##### Remember these important facts: ... * Language tags are not case-sensitive. en-US, en-us, En-Us, etc., are all the same tag, and denote the same language. ##### So the function accepts input in mixed case and consistently returns lower case. Example: ##### $ for f in az uz sr; do echo -n $f | perl -E 'use I18N::LangTags::List; $g=<>;$a="$g-LATN";$u="$g-Latn";$l="$g-latn";say $a;say I18N::LangTags::List::name($a);say ""; say $u;say I18N::LangTags::List::name($u); say ""; say $l;say I18N::LangTags::List::name($l); say "";'; done az-LATN Azerbaijani (Subform "latn") az-Latn Azerbaijani (Subform "latn") az-latn Azerbaijani (Subform "latn") uz-LATN Uzbek (Subform "latn") uz-Latn Uzbek (Subform "latn") uz-latn Uzbek (Subform "latn") sr-LATN Serbian (Subform "latn") sr-Latn Serbian (Subform "latn") sr-latn Serbian (Subform "latn") ##### Would a small documentation patch improve matters? Thank you very much. -- James E Keenan (jkeenan@cpan.org)
Date: Tue, 10 Apr 2018 10:52:32 +0200
Subject: Re: [perl #133093] I18N::LangTags::List name failes for az-*
From: Martin Barth <martin [...] senfdax.de>
To: perlbug-followup [...] perl.org
There are probably even more langtags affected: e.g {zh-Hans} Chinese, in simplified script; {zh-Hant} Chinese, in traditional script; Am 09.04.2018 um 16:40 schrieb James E Keenan via RT: Show quoted text
> On Mon, 09 Apr 2018 08:37:39 GMT, martin@senfdax.de wrote:
>> This is a bug report for perl from martin@senfdax.de, >> generated with the help of perlbug 1.40 running under perl 5.26.0. >> >> >> ----------------------------------------------------------------- >> I think that the sub name does not respond corret to 'az-Latn', >> 'az-Arab' and 'az-Cyrl'. The results returns the "subform fallback" >> because the string 'az-Arab' in the POD contains a uppercase char >> while >> sub name() invokes lc() on $_[0] >>
>>> perl -E 'use I18N::LangTags::List; $I18N::LangTags::List::Debug = 1;
>> say I18N::LangTags::List::name("az-Latn")' >> Input: {az-latn} >> Shaving off: -latn leaving az >> Output: {Azerbaijani}{-latn} >> Azerbaijani (Subform "latn") >>
> I believe that this is at most a minor documentation flaw. > > 'perldoc I18N::LangTags::List' specifically states: > > ##### > Remember these important facts: > ... > * Language tags are not case-sensitive. en-US, en-us, En-Us, etc., are all the same tag, and denote the same language. > ##### > > So the function accepts input in mixed case and consistently returns lower case. Example: > > ##### > $ for f in az uz sr; do echo -n $f | perl -E 'use I18N::LangTags::List; $g=<>;$a="$g-LATN";$u="$g-Latn";$l="$g-latn";say $a;say I18N::LangTags::List::name($a);say ""; say $u;say I18N::LangTags::List::name($u); say ""; say $l;say I18N::LangTags::List::name($l); say "";'; done > az-LATN > Azerbaijani (Subform "latn") > > az-Latn > Azerbaijani (Subform "latn") > > az-latn > Azerbaijani (Subform "latn") > > uz-LATN > Uzbek (Subform "latn") > > uz-Latn > Uzbek (Subform "latn") > > uz-latn > Uzbek (Subform "latn") > > sr-LATN > Serbian (Subform "latn") > > sr-Latn > Serbian (Subform "latn") > > sr-latn > Serbian (Subform "latn") > ##### > > Would a small documentation patch improve matters? > > Thank you very much. >
From: Martin Barth <martin [...] senfdax.de>
Subject: Re: [perl #133093] I18N::LangTags::List name failes for az-*
Date: Mon, 9 Apr 2018 16:43:44 +0200
To: perlbug-followup [...] perl.org
Download (untitled) / with headers
text/plain 2.1k

only if you change the pod in lines 355 ff.

https://metacpan.org/source/SHAY/perl-5.26.1/dist/I18N-LangTags/lib/I18N/LangTags/List.pm#L355

The expected result of

I18N::LangTags::List::name('az-Latn') would be Azerbaijani in Latin script.

Am 09.04.2018 um 16:40 schrieb James E Keenan via RT:
Show quoted text
On Mon, 09 Apr 2018 08:37:39 GMT, martin@senfdax.de wrote:
This is a bug report for perl from martin@senfdax.de,
generated with the help of perlbug 1.40 running under perl 5.26.0.


-----------------------------------------------------------------
I think that the sub name does not respond corret to 'az-Latn',
'az-Arab' and 'az-Cyrl'. The results returns the "subform fallback"
because the string 'az-Arab' in the POD contains a uppercase char
while
sub name() invokes lc() on $_[0]

perl -E 'use I18N::LangTags::List; $I18N::LangTags::List::Debug = 1;
say I18N::LangTags::List::name("az-Latn")'
Input: {az-latn}
Shaving off: -latn leaving az
Output: {Azerbaijani}{-latn}
Azerbaijani (Subform "latn")

I believe that this is at most a minor documentation flaw.

'perldoc I18N::LangTags::List' specifically states:

#####
Remember these important facts:
...
*   Language tags are not case-sensitive. en-US, en-us, En-Us, etc., are all the same tag, and denote the same language.
#####

So the function accepts input in mixed case and consistently returns lower case.  Example:

#####
$ for f in az uz sr; do echo -n $f | perl -E 'use I18N::LangTags::List; $g=<>;$a="$g-LATN";$u="$g-Latn";$l="$g-latn";say $a;say I18N::LangTags::List::name($a);say "";  say $u;say I18N::LangTags::List::name($u); say ""; say $l;say I18N::LangTags::List::name($l); say "";'; done
az-LATN
Azerbaijani (Subform "latn")

az-Latn
Azerbaijani (Subform "latn")

az-latn
Azerbaijani (Subform "latn")

uz-LATN
Uzbek (Subform "latn")

uz-Latn
Uzbek (Subform "latn")

uz-latn
Uzbek (Subform "latn")

sr-LATN
Serbian (Subform "latn")

sr-Latn
Serbian (Subform "latn")

sr-latn
Serbian (Subform "latn")
#####

Would a small documentation patch improve matters?

Thank you very much.




This service is sponsored and maintained by Best Practical Solutions and runs on Perl.org infrastructure.

For issues related to this RT instance (aka "perlbug"), please contact perlbug-admin at perl.org