in reply to LOCALE on non-posix compliant systems (Win32) ?

My quick reading on locale-related functions in the Win32 SDK documentation indicates that locale support under Win32 is much the same as under Unix or other platforms that support ANSI C.

Perhaps you could be more specific? What have you tried? How did it not work?

        - tye (but my friends call me "Tye")
  • Comment on (tye)Re: LOCALE on non-posix compliant systems (Win32) ?

Replies are listed 'Best First'.
Re: (tye)Re: LOCALE on non-posix compliant systems (Win32) ?
by joustin (Initiate) on Mar 26, 2001 at 21:17 UTC
    All right...
    I want to use locales under Win2k. I've tried just setting the locales with use locale; This gives me extra characters, which are NOT polish ones (which I need). Specifying the standard with setlocale(LC_CTYPE, "pl"); ..didn't work...
    MAN gives the url: ftp://dkuug.dk/i18n/WG15-collection There's a collection of locale definition files, but I have no idea how to merge one into Windows. I need locales to properly sort(), s/// and cmp.

    the test:   use locale; $a="Pérl"; $b = uc($a); print $b; ...returns:PéRL

    the test2:

    for ($x = 0;$x < 255;$x++){ $_ = chr($x); if (/\w/){ print "$_ ";} }

    This one will print You all known word characters... when You've got the PL locale, you should be getting also '³ ó œ æ Ÿ ¿ ñ'

    Mbr> Thanks!

    Edit 2001-03-26 by tye remove <pre>

      Two trains of thought :

      OS goodies

      First off, I'd make sure you've got a locale.inf file in %windir%\inf directory. This is the definition file for locales.
      Then verify that your language is set to Polish in the Regional Settings control panel.

      Perl Goodies

      perl -V:d_setlocale should return "define".</code>This means that perl thinks it can handle locales. If this doesn't return define, ain't nothing gonna work
      try using the locales ISO-8859-4 or ISO-8859-2 instead of pl in setlocale. These are Baltic and Central European charsets, respectively. There's 7 or so environment variables you can set if setlocale doesn't seem to work:
      • LC_ALL
      • LC_CTYPE
      • LC_COLLATE
      • LC_MONETARY
      • LC_NUMERIC
      • LC_TIME
      • LANG
      if this still doesn't work, perl should emit some error telling you that the locale is bad, or some other bad thing is occurring. Good luck!
      Update Don't change locales when running scripts in Excel, or you'll mess up any currency values :(. I take it that this Z3 thing is for Zloty??
        1
        There's no locale.inf file on my disk(s) :(
        My locale settings in CP are set properly ..

        The perl -V:d_setlocale returned defined...

        2
        Changing env's did nothing :((
        Tried specifying the codepage will full name, that is: "pl_PL.ISO8859-2"

        Zloty should be ''z³oty"... thx anyways :\