GNOME Bugzilla – Bug 568705
gtktextbuffer serialization decimal point/comma confusion
Last modified: 2018-05-02 14:40:19 UTC
serialize_value() in gtktextbufferserialize.c serializes double values using g_value_transform() which means that value_transform_double_string() gets used which simply uses g_strdup_sprintf() with a %f format. This means the serialized value has a locale-dependent decimal symbol. deserialize_value() on the other hand deserializes double values using g_ascii_strtod() which accepts only a decimal point. Clearly this means problems. The values of text attributes like "scale" don't get parsed correctly in a locale that uses decimal comma. Mitch also said on IRC that "(if at all!) the code needs to check for a transformable type *last* in order to be as safe as possible against app-registered transform functions"
Created attachment 127000 [details] [review] Suggested patch
There's the G_ASCII_DTOSTR_BUF_SIZE for this.: + gchar buffer[50]; + g_ascii_dtostr (buffer, sizeof (buffer), g_value_get_double (value));
Yes, I've seen that too, but the code has other major issues that need to be addressed. I'll patch them away in the next few days.
That never happened, or did it ?
Argh apparently not, I totally forgot. Will keep this browser tab open now :)
We're moving to gitlab! As part of this move, we are moving bugs to NEEDINFO if they haven't seen activity in more than a year. If this issue is still important to you and still relevant with GTK+ 3.22 or master, please reopen it and we will migrate it to gitlab.
As announced a while ago, we are migrating to gitlab, and bugs that haven't seen activity in the last year or so will be not be migrated, but closed out in bugzilla. If this bug is still relevant to you, you can open a new issue describing the symptoms and how to reproduce it with gtk 3.22.x or master in gitlab: https://gitlab.gnome.org/GNOME/gtk/issues/new
Did I really forget this... sorry, reopening.
-- GitLab Migration Automatic Message -- This bug has been migrated to GNOME's GitLab instance and has been closed from further activity. You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.gnome.org/GNOME/gtk/issues/311.