GNOME Bugzilla – Bug 535865
Gweather library doesn't return UTF-8 character string in non-UTF-8 locale (ja_JP.eucJP)
Last modified: 2008-10-13 17:46:56 UTC
Please describe the problem: Unreadable character string is output to Clock applet's Clock Preference window and Weather Report applet's Details window. Refer Screenshot-clock-1.png and Screenshot-gweather-1.png Steps to reproduce: Actual results: Expected results: Does this happen every time? Other information: I made a dirty patch referring for eel-i18n.h and eel-i18n.c. But, it is practicable enough. Refer Screenshot-clock-2.png and Screenshot-gweather-2.png
Created attachment 111828 [details] Screenshot-clock-1.png
Created attachment 111829 [details] Screenshot-gweather-1.png
Created attachment 111830 [details] [review] libgweather-i18n.patch
Created attachment 111831 [details] Screenshot-clock-2.png
Created attachment 111832 [details] Screenshot-gweather-2.png
I don't think we need all the changes: we just need to call bindtextdomain() & friends once. Having a gweather_i18n_init() static function that would be called from weather_location_new() is most probably enough.
To be sure, I leave it to you. よろぴく:-)
Created attachment 114469 [details] [review] libgweather-i18n.patch I made a new patch according to your ideas. My best regards.(_ _)
Hrm. I would guess that we actually need to also call this function in gweather_location_new_world(), gweather_gconf_new(), some of the gweather_prefs_*() functions, gweather_location_entry_new(), gweather_timezone_menu_new() Maybe also gweather_xml_load_locations(), but I think this will get private in the future, though. Dan, what do you think?
bug 523583 demonstrates that this could turn into a crasher since lots of code is going to assume that it's receiving valid UTF-8 and might pass it to functions that don't validate it.
Created attachment 118433 [details] [review] revised patch Given the number of places a call to gweather_i18n_init() would need to be added, I think Minoru's original approach works better. Here's an updated patch (that uses g_once, etc). Given that we haven't actually seen any crashes because of this in gweather-applet/intlclock, and that 2.23.92 is already out there and there are no more releases left before 2.24.0, I guess it's probably better to wait and put this into 2.24.1, rather than risking accidentally breaking libgweather i18n completely in 2.24.0.
committed for 2.24.1
*** Bug 555378 has been marked as a duplicate of this bug. ***
*** Bug 551319 has been marked as a duplicate of this bug. ***
*** Bug 547425 has been marked as a duplicate of this bug. ***
*** Bug 549927 has been marked as a duplicate of this bug. ***
*** Bug 535624 has been marked as a duplicate of this bug. ***
*** Bug 546311 has been marked as a duplicate of this bug. ***
*** Bug 555808 has been marked as a duplicate of this bug. ***
*** Bug 555991 has been marked as a duplicate of this bug. ***