After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 535865 - Gweather library doesn't return UTF-8 character string in non-UTF-8 locale (ja_JP.eucJP)
Gweather library doesn't return UTF-8 character string in non-UTF-8 locale (j...
Status: RESOLVED FIXED
Product: libgweather
Classification: Core
Component: general
2.22.x
Other All
: Normal major
: 2.24.0
Assigned To: libgweather-maint
libgweather-maint
: 535624 546311 547425 549927 551319 555378 555808 555991 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2008-05-31 02:12 UTC by Minoru Hashima
Modified: 2008-10-13 17:46 UTC
See Also:
GNOME target: ---
GNOME version: 2.21/2.22


Attachments
Screenshot-clock-1.png (10.47 KB, image/png)
2008-05-31 02:21 UTC, Minoru Hashima
  Details
Screenshot-gweather-1.png (13.33 KB, image/png)
2008-05-31 02:23 UTC, Minoru Hashima
  Details
libgweather-i18n.patch (4.06 KB, patch)
2008-05-31 02:24 UTC, Minoru Hashima
needs-work Details | Review
Screenshot-clock-2.png (9.72 KB, image/png)
2008-05-31 02:26 UTC, Minoru Hashima
  Details
Screenshot-gweather-2.png (11.30 KB, image/png)
2008-05-31 02:27 UTC, Minoru Hashima
  Details
libgweather-i18n.patch (891 bytes, patch)
2008-07-13 06:21 UTC, Minoru Hashima
none Details | Review
revised patch (4.43 KB, patch)
2008-09-10 14:35 UTC, Dan Winship
none Details | Review

Description Minoru Hashima 2008-05-31 02:12:48 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
Comment 1 Minoru Hashima 2008-05-31 02:21:14 UTC
Created attachment 111828 [details]
Screenshot-clock-1.png
Comment 2 Minoru Hashima 2008-05-31 02:23:19 UTC
Created attachment 111829 [details]
Screenshot-gweather-1.png
Comment 3 Minoru Hashima 2008-05-31 02:24:44 UTC
Created attachment 111830 [details] [review]
libgweather-i18n.patch
Comment 4 Minoru Hashima 2008-05-31 02:26:21 UTC
Created attachment 111831 [details]
Screenshot-clock-2.png
Comment 5 Minoru Hashima 2008-05-31 02:27:11 UTC
Created attachment 111832 [details]
Screenshot-gweather-2.png
Comment 6 Vincent Untz 2008-06-18 13:11:41 UTC
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.
Comment 7 Minoru Hashima 2008-06-19 08:02:23 UTC
To be sure, I leave it to you.
よろぴく:-)
Comment 8 Minoru Hashima 2008-07-13 06:21:43 UTC
Created attachment 114469 [details] [review]
libgweather-i18n.patch

I made a new patch according to your ideas.
My best regards.(_ _)
Comment 9 Vincent Untz 2008-09-01 20:40:44 UTC
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?
Comment 10 Dan Winship 2008-09-10 14:06:42 UTC
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.
Comment 11 Dan Winship 2008-09-10 14:35:41 UTC
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.
Comment 12 Dan Winship 2008-09-29 16:31:37 UTC
committed for 2.24.1
Comment 13 Dan Winship 2008-10-08 15:11:19 UTC
*** Bug 555378 has been marked as a duplicate of this bug. ***
Comment 14 Dan Winship 2008-10-08 15:11:55 UTC
*** Bug 551319 has been marked as a duplicate of this bug. ***
Comment 15 Dan Winship 2008-10-08 15:14:30 UTC
*** Bug 547425 has been marked as a duplicate of this bug. ***
Comment 16 Dan Winship 2008-10-08 15:15:14 UTC
*** Bug 549927 has been marked as a duplicate of this bug. ***
Comment 17 Dan Winship 2008-10-08 15:20:19 UTC
*** Bug 535624 has been marked as a duplicate of this bug. ***
Comment 18 Dan Winship 2008-10-08 15:40:59 UTC
*** Bug 546311 has been marked as a duplicate of this bug. ***
Comment 19 Dan Winship 2008-10-13 17:46:32 UTC
*** Bug 555808 has been marked as a duplicate of this bug. ***
Comment 20 Dan Winship 2008-10-13 17:46:56 UTC
*** Bug 555991 has been marked as a duplicate of this bug. ***