From: Bjoern V. <bj...@cs...> - 2006-02-09 20:11:22
|
Richard Laager <rl...@wi...> wrote: > On a related note... What charset does gettext() return strings in? The > man page says : > > RETURN VALUE > If a translation was found in one of the specified catalogs, it > is converted to the locale=FF=FFs codeset and returned. Yes, gettext always returns UTF-8 within Gaim. There is the following line =09bind_textdomain_codeset(PACKAGE, "UTF-8"); in src/gtkmain.c. bind_textdomain_codeset() specifies the output codeset for gettext. > I ask because we shouldn't be passing UTF-8 to strftime(). So, if > gettext() returns UTF-8 in non-UTF-8 locales, then I need to convert it > in gaim_utf8_strftime(). However, if gettext() does behave as the man > page suggests, doesn't that cause problems with GTK+? Why not? If I understood Ambrose Li right, he needs some special UTF-8 chars in Chinese date/time strings. I tested strftime() with UTF-8 chars in date/time format strings with Linux (SuSE Linux 10.x) and Solaris 5.9. I believe, that other systems also can pass UTF-8 into strftime(). I attached a small test file for this. I also do not see a solution in converting the UTF-8 date/time string before passing into strftime(). Since the UTF-8 chars are needed (for instance in Chinese), you had to convert the charset twice: 1) UTF-8 (gettext-output) to ASCII (strftime-input) 2) ASCII to UTF-8 (strftime-out) to GTK+ Greetings, Bj=F6rn |