Boost logo

Boost Users :

From: Yeti_RO (jokerjokerer_at_[hidden])
Date: 2008-02-07 03:30:05


Well shortly presented. We have this code form the Boost
[url=http://www.boost.org/libs/serialization/doc/codecvt.html]site.[/url]

// My encoding type
  typedef wchar_t ucs4_t;

  std::locale old_locale;
  std::locale utf8_locale(old_locale,new utf8_codecvt_facet<ucs4_t>);

  // Set a New global locale
  std::locale::global(utf8_locale);

  // Send the UCS-4 data out, converting to UTF-8
  {
    std::wofstream ofs("data.ucd");
    ofs.imbue(utf8_locale);
    std::copy(ucs4_data.begin(),ucs4_data.end(),
          std::ostream_iterator<ucs4_t,ucs4_t>(ofs));
  }

And the error messages:

 : error C2661: 'std::locale::facet::operator new' : no overloaded function
takes 3 arguments
 : error C2059: syntax error : ')'
 : error C2065: 'utf8_locale' : undeclared identifier
 : error C2065: 'ucs4_data' : undeclared identifier
 : error C2228: left of '.begin' must have class/struct/union

Any ideas why ? ANd mainly how to fix it ?

Am I using something wrong. Any other advice.

-- 
View this message in context: http://www.nabble.com/A-strange-local-facet-error.-tp15249652p15249652.html
Sent from the Boost - Users mailing list archive at Nabble.com.

Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net