OT: CODESET problem

Good day,

Sorry about using these lists, but I know there is some experienced
programmers who could help me.

I am using latest GTK/GTKMM releases on REDHAT Linux 7.1 for my app.

Problem is - g_get_charset function is initialized with two different
charsets if it is called from different parts of my application.
In my case:

  - firts call to g_get_charset() directly just when GTK initialized -
returns "KOI8-R" - correct.

  - first call to g_get_charset() deep in my app when I am using
std::cerr << <Glib::ustinrg> - ustring.cc calls Glib::locale_from_utf8()
and then charset is initialized with "ANSI_X3.4-1968" - incorrect, cuz
caused convert exception.

When I 've been searching in GLIB sources I've found it uses nl_langinfo
(CODESET) call to determine system charset. And exactly this function
returns that "ANSI_X3.4-1968" and "KOI8-R".

Quote from langinfo.h:

/* Return the current locale's value for ITEM.
   If ITEM is invalid, an empty string is returned.

   The string returned will not change until `setlocale' is called;
   it is usually in (!) read-only memory and cannot be modified (!).  */

extern char *nl_langinfo (nl_item __item) __THROW;

Could someone point me at the place where should I look for to resolve
this problem:
 -my app
 -my OS
 -some libs
 -web site with description of codeset management

(I wouldn't like solution - call g_get_charset() in place where it works
well. It is definatelly bug somewhere, and it will be pain if we gonna
meet it in some real software)

Thanks a lot in advance,

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