Reinhard Pagitsch wrote: >Hello Steve, > >Steve Hay wrote: > > > >>Reinhard Pagitsch wrote: >> >> >> >>>Sisyphus wrote: >>> >>> >>> >>> >>> >>>>Reinhard Pagitsch wrote: >>>> >>>> >>>> >>>> >>>> >>>>>Hello Steve, >>>>> >>>>>Steve Hay wrote: >>>>> >>>>> >>>>> >>>>> >>>>> >>>>>>why is it that the following XS code outputs -25: >>>>>> >>>>>> >>>>>[code sniped] >>>>> >>>>>On my system (Windows 2000) the output is -1, as expected. >>>>> >>>>> >>>>> >>>>> >>>>> >>>>I'm also on Windows 2000 but I'm getting the same weird behaviour as >>>>Steve - wrt to each of MinGW (gcc) *and* MSVC++ 6.0 *and* MSVC++ 7.0. >>>>(I have perls 5.8 built with each of those 3 compilers.) >>>> >>>>I have no idea why this is happening. >>>> >>>>Cheers, >>>>Rob >>>> >>>> >>>> >>>> >>>I use the "Microsoft Visual C++ Toolkit 2003" and the "Microsoft >>>Platform SDK February 2003" and >>>perl v5.6.1 from Activestate >>> >>> >>> >>> >>Interesting. I just tried using the C++ Toolkit 2003 and I now get +1 / >>-1 from the XS too. (It is VC++ 6.0 that gives me >1 / <1.) >> >>Perl 5.6.1 and 5.8.6 both behave the same, though, and ActiveState >>builds are no different either. >> >> >> >> >>>Maybe there is an implementation of stricmp in Perl which overwrites the >>>implementation from the other? >>> >>> >>> >>I couldn't see anything like that in the sources. The only mention of >>stricmp() were a few calls to it in win32/win32.c. >> >>- Steve >> >> >> >> >It seems to me it had something todo with the locale. If I use char >* ret = setlocale( LC_ALL, "English" ); >befor than I get for stricmp("a", "z") -25. > Bizarre. What locale were you using before when you got -1?
If I call setlocale(LC_ALL, "German") (which returns "German_Germany.1252") then I still get -25. - Steve ------------------------------------------------ Radan Computational Ltd. The information contained in this message and any files transmitted with it are confidential and intended for the addressee(s) only. If you have received this message in error or there are any problems, please notify the sender immediately. The unauthorized use, disclosure, copying or alteration of this message is strictly forbidden. Note that any views or opinions presented in this email are solely those of the author and do not necessarily represent those of Radan Computational Ltd. The recipient(s) of this message should check it and any attached files for viruses: Radan Computational will accept no liability for any damage caused by any virus transmitted by this email.