From: Ethan B. <ebl...@cs...> - 2006-02-10 19:37:52
|
Richard Laager spake unto us the following wisdom: > The formatters passed to strftime() expand to strings in locale format. > Thus, to use them in Gaim, we convert the output of strftime() to UTF-8. Ahh, I didn't understand your question the first time around. This is kind of ugly. > I imagine the correct approach is this: >=20 > 1. Pass the format string from Gaim to gettext(). > 2. Convert the output from gettext() from UTF-8 to locale format. > 3. Pass the translated, locale-converted string to strftime(). > 4. Convert the output of strftime() back to UTF-8. Yeah, this might be the best way to do it ... but it's disgusting. The Right Way to do it would be to set the locale to a UTF-8 locale within Gaim, but unfortunately locale names are not at all portable. I just poked through the locale functions, and didn't see a good way to bind the current charset to UTF-8 regardless of locale. Ugh. Ethan --=20 The laws that forbid the carrying of arms are laws [that have no remedy for evils]. They disarm only those who are neither inclined nor determined to commit crimes. -- Cesare Beccaria, "On Crimes and Punishments", 1764 |