Re: No yet encrypted...
- From: Chris Vine <chris cvine freeserve co uk>
- To: Glus Xof <gtglus gmail com>
- Cc: gtkmm-list gnome org
- Subject: Re: No yet encrypted...
- Date: Mon, 5 Dec 2011 16:58:21 +0000
On Mon, 5 Dec 2011 17:32:30 +0100
Glus Xof <gtglus gmail com> wrote:
[snip]
> >> g_free (r_mess);
> >>
> >> std::cout
> >> << Glib::ustring::compose ("# %1", mess)
> >> << std::endl;
> >>
>
> The problem, here, is that this code works fine with one-byte
> characters string but breaks with multi-byte characters strings !
It would help if you said what "breaks" means. Do you mean it throws a
conversion exception? If so then:
std::cout << Glib::ustring::compose("# %1", mess).raw()
<< std::endl;
will probably work, but you need to consider your character encodings
more carefully to cover all cases, as this is not of itself a robust
solution. It would mean that the text you are putting into 'mess' is
not in fact in utf-8 encoding, or you have done something else wrong
like not calling std::locale::global(std::locale("")).
What calling ustring::raw() would do here is suppress the implicit
conversion into the locale encoding carried out by the operator<<()
overload for Glib::ustring.
Chris
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]