Re: std::cout << Glib::ustring(utf8_literal) throws exception
- From: Chris Vine <chris cvine freeserve co uk>
- To: Sohail Somani <sohail taggedtype net>
- Cc: gtkmm-list gnome org
- Subject: Re: std::cout << Glib::ustring(utf8_literal) throws exception
- Date: Sun, 13 Jul 2008 23:05:59 +0100
On Sun, 13 Jul 2008 14:54:38 -0700
Sohail Somani <sohail taggedtype net> wrote:
> Chris Vine wrote:
> > Conversions can fail for various reasons, but to start from the
> > beginning have you set a locale of any kind which handles non-ascii
> > characters? In particular, have you called setlocale(LC_ALL,""),
> > or the equivalent std::locale::global(std::locale(""))? If you
> > have not, the C locale will be used and any glibmm conversion will
> > throw an exception if a byte of value >= 128 is met.
>
> Yes, I have tried both.
Possibly then your machine locale cannot handle the characters that you
are trying to feed to it (unless a narrow character codeset is UTF-8 it
is probably limited to around 200 different characters). If setting
your machine locale to UTF-8 works, that is most likely the reason.
Chris
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]