Le 17/03/2013 17:17, Christian Dywan a écrit :
Branch: refs/heads/master Author: Christian Dywan christian@twotoasts.de Committer: Enrico Tröger enrico.troeger@uvena.de Date: Sun, 17 Mar 2013 16:17:09 UTC Commit: d270e6c69082d114901af23b756a3375a5b5ce23 https://github.com/geany/geany/commit/d270e6c69082d114901af23b756a3375a5b5ce...
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
And opening it without changing the LANG results in:
(geany:23294): Gtk-WARNING **: Failed to set text from markup due to error parsing markup: Erreur à la ligne 1, caractère 70 : Codage UTF-8 non valide dans le nom - « (construit le x\xc5\u0015\xc0\xff\u007f ou ultérieurement) » n'est pas valide
(geany:23294): Gtk-WARNING **: Failed to set text from markup due to error parsing markup: Erreur à la ligne 1, caractère 70 : Codage UTF-8 non valide dans le nom - « (construit le x\xc5\u0015\xc0\xff\u007f ou ultérieurement) » n'est pas valide
(geany:23294): Gtk-WARNING **: Failed to set text from markup due to error parsing markup: Erreur à la ligne 1, caractère 70 : Codage UTF-8 non valide dans le nom - « (construit le x\xc5\u0015\xc0\xff\u007f ou ultérieurement) » n'est pas valide
Modified Paths:
src/about.c
Modified: src/about.c 8 files changed, 7 insertions(+), 1 deletions(-) =================================================================== @@ -31,6 +31,7 @@ #include "support.h" #include "geanywraplabel.h" #include "main.h" +#include "templates.h"
#include "gb.c"
@@ -152,6 +153,8 @@ static GtkWidget *create_dialog(void) gchar buffer[512]; gchar buffer2[128]; guint i, row = 0;
struct tm builddate_tm;
char builddate_local[255];
dialog = gtk_dialog_new();
@@ -224,7 +227,10 @@ static GtkWidget *create_dialog(void) gtk_label_set_justify(GTK_LABEL(builddate_label), GTK_JUSTIFY_CENTER); gtk_label_set_selectable(GTK_LABEL(builddate_label), TRUE); gtk_label_set_use_markup(GTK_LABEL(builddate_label), TRUE);
- g_snprintf(buffer2, sizeof(buffer2), _("(built on or after %s)"), __DATE__);
- memset(&builddate_tm, 0, sizeof(struct tm));
- strptime(__DATE__, "%b %d %Y", &builddate_tm);
- strftime(builddate_local, sizeof(builddate_local), GEANY_TEMPLATES_FORMAT_DATE, &builddate_tm);
- g_snprintf(buffer2, sizeof(buffer2), _("(built on or after %s)"), builddate_local); g_snprintf(buffer, sizeof(buffer), BUILDDATE, buffer2); gtk_label_set_markup(GTK_LABEL(builddate_label), buffer); gtk_misc_set_padding(GTK_MISC(builddate_label), 2, 2);
This E-Mail was brought to you by github_commit_mail.py (Source: https://github.com/geany/infrastructure). _______________________________________________ Commits mailing list Commits@lists.geany.org https://lists.geany.org/cgi-bin/mailman/listinfo/commits
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@twotoasts.de Committer: Enrico Tröger enrico.troeger@uvena.de Date: Sun, 17 Mar 2013 16:17:09 UTC Commit: d270e6c69082d114901af23b756a3375a5b5ce23 https://github.com/geany/geany/commit/d270e6c69082d114901af23b756a3375a5b5ce...
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.
And opening it without changing the LANG results in:
(geany:23294): Gtk-WARNING **: Failed to set text from markup due to error parsing markup: Erreur à la ligne 1, caractère 70 : Codage UTF-8 non valide dans le nom - « (construit le x\xc5\u0015\xc0\xff\u007f ou ultérieurement) » n'est pas valide
(geany:23294): Gtk-WARNING **: Failed to set text from markup due to error parsing markup: Erreur à la ligne 1, caractère 70 : Codage UTF-8 non valide dans le nom - « (construit le x\xc5\u0015\xc0\xff\u007f ou ultérieurement) » n'est pas valide
(geany:23294): Gtk-WARNING **: Failed to set text from markup due to error parsing markup: Erreur à la ligne 1, caractère 70 : Codage UTF-8 non valide dans le nom - « (construit le x\xc5\u0015\xc0\xff\u007f ou ultérieurement) » n'est pas valide
OK, this one was fixed like I mentioned in the other mail.
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@twotoasts.de Committer: Enrico Tröger enrico.troeger@uvena.de Date: Sun, 17 Mar 2013 16:17:09 UTC Commit: d270e6c69082d114901af23b756a3375a5b5ce23 https://github.com/geany/geany/commit/d270e6c69082d114901af23b756a3375a5b5ce...
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.
On 18 March 2013 10:31, Colomban Wendling lists.ban@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@twotoasts.de Committer: Enrico Tröger enrico.troeger@uvena.de Date: Sun, 17 Mar 2013 16:17:09 UTC Commit: d270e6c69082d114901af23b756a3375a5b5ce23 https://github.com/geany/geany/commit/d270e6c69082d114901af23b756a3375a5b5ce...
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.
Since it is only translating a build date, this seems a pretty heavy set of warnings for some users to get.
If I understand the problem is inside glib so we can't fix it and it depends on user settings.
Perhaps instead we should not try to translate the build date and use a language independent format like a ISO8601 format.
After all a build date is meant to be unambiguous, not pretty :)
Cheers Lex
Devel mailing list Devel@lists.geany.org https://lists.geany.org/cgi-bin/mailman/listinfo/devel
Perhaps instead we should not try to translate the build date and use a language independent format like a ISO8601 format.
Obligatory xkcd reference http://xkcd.com/1179/ :)
After all a build date is meant to be unambiguous, not pretty :)
Cheers Lex
Devel mailing list Devel@lists.geany.org https://lists.geany.org/cgi-bin/mailman/listinfo/devel
On 18/03/13 01:27, Lex Trotman wrote:
On 18 March 2013 10:31, Colomban Wendling lists.ban@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@twotoasts.de Committer: Enrico Tröger enrico.troeger@uvena.de Date: Sun, 17 Mar 2013 16:17:09 UTC Commit: d270e6c69082d114901af23b756a3375a5b5ce23 https://github.com/geany/geany/commit/d270e6c69082d114901af23b756a3375a5b5ce...
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.
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?
Since it is only translating a build date, this seems a pretty heavy set of warnings for some users to get.
If I understand the problem is inside glib so we can't fix it and it depends on user settings.
Perhaps instead we should not try to translate the build date and use a language independent format like a ISO8601 format.
After all a build date is meant to be unambiguous, not pretty :)
Basically true, though at a conference last weekend Christian Dywan suggested to make it translatable (and he did) and this seemed quite good to me. Since the rest of the surrounding strings around the build date (in the output of --verbose and in the about dialog) are translated, why not also the date. Sure, this is by no means a mandatory change and if it causes that much problems, we maybe should skip it.
Regards, Enrico
On 19 March 2013 02:36, Enrico Tröger enrico.troeger@uvena.de wrote:
On 18/03/13 01:27, Lex Trotman wrote:
On 18 March 2013 10:31, Colomban Wendling lists.ban@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@twotoasts.de Committer: Enrico Tröger enrico.troeger@uvena.de Date: Sun, 17 Mar 2013 16:17:09 UTC Commit: d270e6c69082d114901af23b756a3375a5b5ce23 https://github.com/geany/geany/commit/d270e6c69082d114901af23b756a3375a5b5ce...
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.
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.
Cheers Lex
On 19/03/13 00:09, Lex Trotman wrote:
On 19 March 2013 02:36, Enrico Tröger enrico.troeger@uvena.de wrote:
On 18/03/13 01:27, Lex Trotman wrote:
On 18 March 2013 10:31, Colomban Wendling lists.ban@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@twotoasts.de > Committer: Enrico Tröger enrico.troeger@uvena.de > Date: Sun, 17 Mar 2013 16:17:09 UTC > Commit: d270e6c69082d114901af23b756a3375a5b5ce23 > https://github.com/geany/geany/commit/d270e6c69082d114901af23b756a3375a5b5ce... > > 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.
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