On 27 June 2011 16:34, <asyropoulos@xxxxxxx> wrote: >> - if you start it was an utf-8--encoding, (like el_GR.UTF-8), >> everything should run fine IF this encoding exists on your machine. > > I am a bit confused: what do you mean by encoding? At any rate, I have > compiled and run your much improved program and here are the results: > > apostolo@mary>> locale > LANG=el_GR.UTF-8 > LC_CTYPE="el_GR.UTF-8" > LC_NUMERIC="el_GR.UTF-8" > LC_TIME="el_GR.UTF-8" > LC_COLLATE="el_GR.UTF-8" > LC_MONETARY="el_GR.UTF-8" > LC_MESSAGES="el_GR.UTF-8" > LC_ALL=el_GR.UTF-8 > apostolo@mary>> ./loctest > trying to access locale el_GR.UTF-8 > Couldn't generate locale el_GR.UTF-8: locale::facet::_S_create_c_locale name > not valid > Error when writing to file void locale::facet::_S_create_c_locale(__c_locale& __cloc, const char* __s, __c_locale) { // Currently, the generic model only supports the "C" locale. // See http://gcc.gnu.org/ml/libstdc++/2003-02/msg00345.html __cloc = 0; if (strcmp(__s, "C")) __throw_runtime_error(__N("locale::facet::_S_create_c_locale " "name not valid")); } Darwin uses that generic definition of that function. When configured to use the ieee_1003.1-2001 locale model, Solaris uses this implementation: void locale::facet::_S_create_c_locale(__c_locale&, const char*, __c_locale*) { } Which does nothing. The locale code needs a lot of work on non-GNU/Linux platforms, people who care about using locales on those platforms need to contribute code.