Re: [gtkmm] minor problem with sorting rows in win32



"B.Hakvoort" <bart hakvoort be> writes:

> It has been some time, but life's been busy lately. Thanks for
> straightening things out. I "solved" it by calling setlocale(LC_COLLATE,
> "nl_NL") in my application. 

If that's your usual locale, the right thing to do here is

  std::setlocale(LC_ALL, "");

which will read LANGUAGE, LANG, LC_ALL, and LC_* from the environment,
rather than hard-coding anything (I would highly recommend this).
Better still, the C++ way would be

  std::locale::global(std::locale("C"));

(which does the same sort of thing, but sets the "global" locale) and
optionally

  std::cin.imbue(std::locale());
  std::cout.imbue(std::locale());
  std::cerr.imbue(std::locale());
  std::clog.imbue(std::locale());

to "imbue" the standard streams with the new global locale.


-- 
Roger Leigh

                Printing on GNU/Linux?  http://gimp-print.sourceforge.net/
                GPG Public Key: 0x25BFB848.  Please sign and encrypt your mail.



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]