Re: Italian letter given to to Glib::ustring causes Glib::ConvertError



Your problem is discussed in bug 661588, https://bugzilla.gnome.org/show_bug.cgi?id=661588

The solution recommended there is

#include <locale>
std::locale::global(std::locale(""));

but your solution is probably good enough.

The documentation of Glib::ustring says you shall add

output.imbue(std::locale(""));

but it doesn't work. That's why the bug was filed. (In your case output is std::cout.)

Kjell

2012-11-05 18:11, Giuseppe Penone skrev:
#include <locale.h>

and

setlocale(LC_ALL, "en_US.utf8");

made the code work without exceptions.

King regards,
Giuseppe.


On Mon, Nov 5, 2012 at 5:28 PM, Giuseppe Penone <giuspen gmail com> wrote:
Hi,
the source file is utf-8 (edited with geany on linux ubuntu 12.04 64 bit), Is my code missing
needed lines?
Thanks,
Giuseppe.



On Mon, Nov 5, 2012 at 5:24 PM, François Legendre <f legendre gmail com> wrote:
Hi,

How your source program is encoded ? If it not utf-8 encoded, I think
you can get this error.

Yours,
----
François





[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]