Boost logo

Boost Users :

From: Martin Adrian (adrianm_at_[hidden])
Date: 2006-11-10 02:21:07


Amin Kharchi <marcoh77 <at> freenet.de> writes:

>
> Hello!
>
> Is it possible to set a locale for the lexical_cast? It looks like that
> it is only possible to convert english/us numbers to a string?

No, it has been suggested several times and has always been rejected.

(The main reason seem to be that anything ending with _cast should only take a
single argument)

However, as long as you are dealing with user input/output is not a big deal
since locale_cast always use the current locale which I assume you set at
program startup. Problems start when you need to convert things with another
locale as well (e.g. SQL statements or csv files).

There is a string_convert library in the vault which allows you to specify
locale and formatting etc but it is very poorly documented and might not work
with all compilers.


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