Skip Menu |
 

This queue is for tickets about the Encode CPAN distribution.

Report information
The Basics
Id: 34653
Status: resolved
Priority: 0/
Queue: Encode

People
Owner: Nobody in particular
Requestors: tco2 [...] cornell.edu
Cc:
AdminCc:

Bug Information
Severity: Critical
Broken in: 2.24
Fixed in: (no value)



Subject: does not recognize default locale '646' on Solaris
Download (untitled) / with headers
text/plain 1.4k
Encode (actually Encode::Alias) does not work with the default locale on Solaris 8/9/10 because Solaris reports the CODESET to be '646' and Encode::Alias does not recognize that. This is a critical issue because it causes :locale to be unrecognized which leads to a segfault in the Perl 5.8.8 distribution (which I'm still trying to pin point the cause of) and thereby breaks tests like the utf8 test recently added to Test::Simple making it difficult to update core modules via cpan. The solution is to add into Encode::Alias in the ASCII section something like define_alias( '646' => 'ascii' ); The issue can be shown with the following bit of Perl code ====== use I18N::Langinfo qw(langinfo CODESET); print langinfo(CODESET()), "\n"; ====== which prints 646 and then ====== use encoding ':locale'; ====== which produces encoding: Unknown encoding '646' at ./t1 line 5 BEGIN failed--compilation aborted at ./t1 line 5. And the following bit of C code verifies the 646 is coming from Solaris ====== #include <locale.h> #include <langinfo.h> #include <nl_types.h> main () { char * v; setlocale(LC_ALL, ""); v = nl_langinfo(CODESET); printf("%s\n", v); } ===== which prints 646 We know that Solaris' CODESET 646 should be understood to be ISO 646 because of http://docs.sun.com/app/docs/doc/806-5584/6jej8rb1g?a=view and because it is also referred to as the "C" locale in Solaris environ(5) in the discussion of LANG Regards, Todd Olson
From: tco2 [...] cornell.edu
Download (untitled) / with headers
text/plain 294b
Show quoted text
> We know that Solaris' CODESET 646 should be understood to be ISO 646 > because of
If we set the environment variable LANG to either C or to POSIX and run the above C code we are told the CODESET is 646 If we set LANG to en_US then we are told the CODESET is ISO8859-1 Regards, Todd Olson
Download (untitled) / with headers
text/plain 1.6k
Fixed in 2.24. Dan the Encode Maintainer On Thu Apr 03 15:53:54 2008, tco2@cornell.edu wrote: Show quoted text
> Encode (actually Encode::Alias) does not work with the default locale > on Solaris 8/9/10 > because Solaris reports the CODESET to be '646' and Encode::Alias does > not recognize that. > This is a critical issue because it causes :locale to be unrecognized > which leads to a segfault > in the Perl 5.8.8 distribution (which I'm still trying to pin point > the cause of) > and thereby breaks tests like the utf8 test recently added to > Test::Simple > making it difficult to update core modules via cpan. > > > The solution is to add into Encode::Alias in the ASCII section > something like > > define_alias( '646' => 'ascii' ); > > The issue can be shown with the following bit of Perl code > ====== > use I18N::Langinfo qw(langinfo CODESET); > print langinfo(CODESET()), "\n"; > ====== > which prints 646 > > and then > ====== > use encoding ':locale'; > ====== > which produces > encoding: Unknown encoding '646' at ./t1 line 5 > BEGIN failed--compilation aborted at ./t1 line 5. > > > > And the following bit of C code verifies the 646 is coming from > Solaris > ====== > #include <locale.h> > #include <langinfo.h> > #include <nl_types.h> > > main () > { char * v; > setlocale(LC_ALL, ""); > v = nl_langinfo(CODESET); > printf("%s\n", v); > } > ===== > which prints 646 > > We know that Solaris' CODESET 646 should be understood to be ISO 646 > because of > http://docs.sun.com/app/docs/doc/806-5584/6jej8rb1g?a=view > and > because it is also referred to as the "C" locale in Solaris environ(5) > in the discussion of LANG > > > Regards, > Todd Olson


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

Please report any issues with rt.cpan.org to rt-cpan-admin@bestpractical.com.