diff options
author | Debarshi Ray <debarshir@src.gnome.org> | 2012-11-14 10:33:18 +0100 |
---|---|---|
committer | Kjell Ahlstedt <kjell.ahlstedt@bredband.net> | 2012-11-14 10:33:18 +0100 |
commit | a22ac716b2eb169c1cdfbe7d1b500c590752965d (patch) | |
tree | daaf71c73ea19d1e11d3f788ce76d25d54db29ae | |
parent | ac6031bee7c386817d20d95604ea85a1992886fa (diff) | |
download | glibmm-a22ac716b2eb169c1cdfbe7d1b500c590752965d.tar.gz |
ustring docs: The global locale should be set when using C++ streams.
* glib/glibmm/ustring.h: Replace output.imbue(std::locale("")) by
std::locale::global(std::locale("")) in the description of how to use
std::ostringstream. Bug #661588.
-rw-r--r-- | ChangeLog | 8 | ||||
-rw-r--r-- | glib/glibmm/ustring.h | 4 |
2 files changed, 10 insertions, 2 deletions
@@ -1,3 +1,11 @@ +2012-11-14 Debarshi Ray <debarshir@src.gnome.org> + + ustring docs: The global locale should be set when using C++ streams. + + * glib/glibmm/ustring.h: Replace output.imbue(std::locale("")) by + std::locale::global(std::locale("")) in the description of how to use + std::ostringstream. Bug #661588. + 2012-11-13 José Alburquerque <jaalburquerque@gmail.com> giomm: Add the TlsPassword class. diff --git a/glib/glibmm/ustring.h b/glib/glibmm/ustring.h index 1780383b..f0fa2176 100644 --- a/glib/glibmm/ustring.h +++ b/glib/glibmm/ustring.h @@ -165,14 +165,14 @@ gunichar get_unichar_from_std_iterator(std::string::const_iterator pos) G_GNUC_P * @par * The stream I/O operators, that is operator<<() and operator>>(), perform * implicit charset conversion to/from the current locale. If that's not - * what you intented (e.g. when writing to a configuration file that should + * what you intended (e.g. when writing to a configuration file that should * always be UTF-8 encoded) use ustring::raw() to override this behaviour. * @par * If you're using std::ostringstream to build strings for display in the * user interface, you must convert the result back to UTF-8 as shown below: * @code + * std::locale::global(std::locale("")); // set the global locale to the user's preferred locale * std::ostringstream output; - * output.imbue(std::locale("")); // use the user's locale for this stream * output << percentage << " % done"; * label->set_text(Glib::locale_to_utf8(output.str())); * @endcode |