Recently i figured out that all locales stopped working properly on some of my 6-STABLE servers and in all jails on them. These server diffeer from others (on which locale work) in that they were upgraded to 6-STABLE directly from 5.3-STABLE. Test was easy: #!/usr/bin/perl use POSIX qw(locale_h); use locale; setlocale(LC_ALL, 'ru_RU.CP1251') || warn "LOCALE: $!\n"; print lc("??????????ABCabc\n")."\n"; (the string is partially in RUssia, so you might not be able to see correctly, but that is not the point). After an hour of figuring out why it does not work i figureed that it was because of /lib/libc.so.5 I chflaged it, deleted it and made a link to libc.so.6 After that setlocale in perl worked fine. However, on another server, where setlocale worked and works fine this libc.so.5 also present and causes no problems. What i don't understand, is how the appropriate 'so' is selected? How freebsd known which so to load this libc.so.5 or this libc.so.6 ? where it is specified? Another question, is why setlocale in C says that locale is set fine. A simple proggie: #include <locale.h> #include <errno.h> #include <ctype.h> main(){ char *b=setlocale(LC_ALL, "ru_RU.CP1251"); if (!b){ printf("FAILED! %d\n",errno); } else { printf("OK: %s %d\n",b,errno); printf("LOCALE %s\n",setlocale(LC_CTYPE,NULL)); printf("1: TO UPPER %c TO LOWER %c\n",toupper('?'),tolower('?')); printf("1-0: TO UPPER %c TO LOWER %c\n",toupper('?'),tolower('?')); printf("2: TO UPPER %c TO LOWER %c\n",toupper('r'),tolower('R')); } } Does not work even when locales work on perl (toupper does not return an upper letter for russia, but works with latin r, same with tolower). Am i missing something? -- Regards, Artem
Stanislaw Halik
2007-May-23 23:44 UTC
Broken locale after upgrade to 6-STABEL from 5-STABLE
On Thu, May 24, 2007, Artem Kuchin wrote:> What i don't understand, is how the appropriate 'so' > is selected? How freebsd known which so to load > this > libc.so.5 > or this > libc.so.6 > ?Did you recompile Perl after the last installworld? If not, do so. -- Whenever you find that you are on the side of the majority, it is time to reform. -- Mark Twain
On Thu, 24 May 2007, Artem Kuchin wrote:> /lib/libc.so.5 > > I chflaged it, deleted it and made a link to > libc.so.6this guy sounds familiar. i am really hosed right now, i can't run a browser simultaneously, maybe i am being really stupid, but what do you mean when you say you "chflaged" it? an explicit unix command line dingy is the sort of thing that makes me happy.> > After that setlocale in perl worked fine. > > However, on another server, where setlocale worked > and works fine this libc.so.5 also present and causes > no problems. > > What i don't understand, is how the appropriate 'so' > is selected? How freebsd known which so to load > this > libc.so.5 > or this > libc.so.6 > ? > > where it is specified? > > Another question, is why setlocale in C > says that locale is set fine. > > A simple proggie: > > #include <locale.h> > #include <errno.h> > #include <ctype.h> > > main(){ > > char *b=setlocale(LC_ALL, "ru_RU.CP1251"); > if (!b){ > printf("FAILED! %d\n",errno); > } > else { > printf("OK: %s %d\n",b,errno); > printf("LOCALE %s\n",setlocale(LC_CTYPE,NULL)); > printf("1: TO UPPER %c TO LOWER %c\n",toupper('?'),tolower('?')); > printf("1-0: TO UPPER %c TO LOWER %c\n",toupper('?'),tolower('?')); > printf("2: TO UPPER %c TO LOWER %c\n",toupper('r'),tolower('R')); > } > } > > Does not work even when locales work on perl (toupper does not > return an upper letter for russia, but works with latin r, same > with tolower). > > Am i missing something? > > > > > -- > Regards, > Artem > _______________________________________________ > freebsd-stable@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-stable > To unsubscribe, send any mail to "freebsd-stable-unsubscribe@freebsd.org" >*----------------------------------------------------------* Kayven Riese, BSCS, MS (Physiology and Biophysics) (415) 902 5513 cellular http://kayve.net Webmaster http://ChessYoga.org *----------------------------------------------------------*