Boost logo

Boost :

Subject: Re: [boost] [locale] Formal review of Boost.Locale library starts tomorrow
From: Artyom (artyomtnk_at_[hidden])
Date: 2011-04-08 14:24:56


>

> AMDG
>
> On 04/08/2011 03:57 AM, Artyom wrote:
> >>
> >> In "Using Localization Backends":
> >>
> >> - You discuss on what platforms the standard library backend is useful.
> >> Where you say "on Linux with GCC or Intel compilers", would it be
> >> better to say "when using the GCC standard library, for example with
> >> GCC, the Intel compiler" since I guess e.g. clang (if used with the gcc
> >> std lib) would work too?
> >>
> >
> > I can't tell, not tested with clang.
> >
> > But I must say that toooo many standard libraries has broken locale
> > support. For example GCC's libstd++ supports locales only
> > on Linux based on libc's (now POSIX but in earlier days non-standard
> > functions like newlocale/duplocale).
> >
> > So I would not be surprised that clang's version of libstd++ compiled
> > with only C/POSIX locales in.
> >
>
> clang uses GCC's libstdc++ directly. It doesn't
> have its own version.
>

If so then it would likely work on Linux, (on all other patforms libstd++
support
only "C" and "POSIX" locales).

In any case the simplest way to check if locales support is useful is
to run this small test:

#include <iostream>
#include <locale>

int main()
{
  try {
    std::locale loc("en_US.UTF-8"); // if installed on system (check locale -a)
    std::cout << "Supported" << std::endl;
  }catch(std::exception const &e) {
    std::cerr << "Not supported" << std::endl;
  }
}

In any case for Linux it is not critical as posix backend is supported.

Artyom


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk