[Geany-Devel] [geany/geany] d270e6: Parse compiler provided build date to use the translatable date format string

Enrico Tröger enrico.troeger at xxxxx
Tue Mar 19 11:54:32 UTC 2013


On 19/03/13 00:09, Lex Trotman wrote:
> On 19 March 2013 02:36, Enrico Tröger <enrico.troeger at uvena.de> wrote:
>> On 18/03/13 01:27, Lex Trotman wrote:
>>> On 18 March 2013 10:31, Colomban Wendling <lists.ban at herbesfolles.org> wrote:
>>>> Le 17/03/2013 19:51, Colomban Wendling a écrit :
>>>>> Le 17/03/2013 17:42, Colomban Wendling a écrit :
>>>>>> Le 17/03/2013 17:17, Christian Dywan a écrit :
>>>>>>> Branch:      refs/heads/master
>>>>>>> Author:      Christian Dywan <christian at twotoasts.de>
>>>>>>> Committer:   Enrico Tröger <enrico.troeger at uvena.de>
>>>>>>> Date:        Sun, 17 Mar 2013 16:17:09 UTC
>>>>>>> Commit:      d270e6c69082d114901af23b756a3375a5b5ce23
>>>>>>>              https://github.com/geany/geany/commit/d270e6c69082d114901af23b756a3375a5b5ce23
>>>>>>>
>>>>>>> Log Message:
>>>>>>> -----------
>>>>>>> Parse compiler provided build date to use the translatable date format string
>>>>>>
>>>>>> I have a system with LANG=fr_FR.UTF-8.
>>>>>>
>>>>>> Opening the about dialog with LANG=C results in:
>>>>>>
>>>>>>
>>>>>> (geany:23003): GLib-WARNING **:
>>>>>> /tmp/buildd/glib2.0-2.33.12+really2.32.4/./glib/gdate.c:2523Error
>>>>>> converting results of strftime to UTF-8: Invalid byte sequence in
>>>>>> conversion input
>>>>>>
>>>>>>
>>>>>> (geany:23003): GLib-WARNING **:
>>>>>> /tmp/buildd/glib2.0-2.33.12+really2.32.4/./glib/gdate.c:2523Error
>>>>>> converting results of strftime to UTF-8: Invalid byte sequence in
>>>>>> conversion input
>>>>>>
>>>>>>
>>>>>> (geany:23003): GLib-WARNING **:
>>>>>> /tmp/buildd/glib2.0-2.33.12+really2.32.4/./glib/gdate.c:2523Error
>>>>>> converting results of strftime to UTF-8: Invalid byte sequence in
>>>>>> conversion input
>>>>>>
>>>>>>
>>>>>> (geany:23003): GLib-WARNING **:
>>>>>> /tmp/buildd/glib2.0-2.33.12+really2.32.4/./glib/gdate.c:2523Error
>>>>>> converting results of strftime to UTF-8: Invalid byte sequence in
>>>>>> conversion input
>>>>>>
>>>>>>
>>>>>> (geany:23003): GLib-WARNING **:
>>>>>> /tmp/buildd/glib2.0-2.33.12+really2.32.4/./glib/gdate.c:2523Error
>>>>>> converting results of strftime to UTF-8: Invalid byte sequence in
>>>>>> conversion input
>>>>>>
>>>>>>
>>>>>> (geany:23003): GLib-WARNING **:
>>>>>> /tmp/buildd/glib2.0-2.33.12+really2.32.4/./glib/gdate.c:2523Error
>>>>>> converting results of strftime to UTF-8: Invalid byte sequence in
>>>>>> conversion input
>>>>>
>>>>> OK apparently if the LANG doesn't have encoding information
>>>>> g_locale_to_utf8() assumes something not UTF-8 (I guess ASCII), and
>>>>> since I didn't change LC_TIME, strftime() did output something the GLib
>>>>> code couldn't handle (with UTF-8 I guess).  Setting LC_TIME=C fixes the
>>>>> issue.
>>>>>
>>>>> Not sure if we can to do something about it.
>>>>
>>>> https://bugzilla.gnome.org/show_bug.cgi?id=408637
>>
>> Sigh, if I knew what problems this can cause, I probably didn't do it...
>> However I wonder if this only happens if someone manually fiddles with
>> LANG and LC_* settings or if it may also happen on "normally" configured
>> system?
>>
> 
> From comments on IRC, there are a number of users who like to run
> their applications in lang=C whilst keeping their desktop using their
> local locale.  So while not very common, it isn't rare.

Ok, good to know.

While playing with this a bit more, I just noticed the compile date
parsing doesn't work as well unless LC_TIME is set to C or en_* or
something else where the month abbrevation in the date (like "Mar") is
compatible with the language setting.

We could maybe change the LC_TIME environment variable before calling
g_date_set_parse() to C and then back afterwards. But this seems very
hacky and might cause even more complications.

So, since this is all just about displaying a date which is also not
that important for the majority of users, I'd just revert the whole
changes, keep it like it was before for years and apologize for the many
confusions it caused.


Regards,
Enrico

-- 
Get my GPG key from http://www.uvena.de/pub.asc

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 198 bytes
Desc: OpenPGP digital signature
URL: <http://lists.geany.org/pipermail/devel/attachments/20130319/f5d08cba/attachment.pgp>


More information about the Devel mailing list