Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

BCC 5.82 global locale fail

Status
Not open for further replies.

Duoas

Programmer
Apr 15, 2008
95
US
Hi all, I'm new to this particular forum.

I am using Borland C++ 5.82, and the following fails:
Code:
...
#include "utf8_locale.hpp"

const std::locale utf8_locale(        // A global object 
  std::locale::classic(),
  new duthomhas::unicode::utf8_facet
  );

int main()
  {
  wofstream outf;
  outf.imbue( utf8_locale );
  ...
But the following works just fine:
Code:
...
#include "utf8_locale.hpp"

int main()
  {
  const std::locale utf8_locale(       // A local object 
    std::locale::classic(),
    new duthomhas::unicode::utf8_facet
    );

  wofstream outf;
  outf.imbue( utf8_locale );
  ...
I admit I am still fairly new to messing with the STL locale class, but I don't understand what I did wrong above. It works fine with the default GCC library. (And I would prefer my code to be as portable as possible.)

Thank you for your time.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top