You are not logged in.

#1 2006-06-18 13:02:28

n3olynx
Member
From: New York, NY
Registered: 2004-12-06
Posts: 46

c++ locale

I'm having problems setting the locale to something other than "C"
The following line works

locale langLocale("C");

but when i try something else such as

locale langLocale("en_US");

This is the error I get:

terminate called after throwing an instance of 'std::runtime_error'
  what():  locale::facet::_S_create_c_locale name not valid
Aborted

I get a runtime error. Has anyone else encountered this problem? What am I doing wrong?

Offline

#2 2006-06-19 14:31:30

MikeJS
Member
Registered: 2005-12-30
Posts: 2

Re: c++ locale

I think you need to include a charset, like en_US.UTF-8. You can get a list of locales on your system w/

locale -a

Offline

#3 2006-06-19 14:48:46

n3olynx
Member
From: New York, NY
Registered: 2004-12-06
Posts: 46

Re: c++ locale

nope...tried it already with the locales listed in locale -a
Maybe it has something to do with glibc and some compile options?

Offline

Board footer

Powered by FluxBB