app/dialogs/image-properties-dialog.c (image_comment_update) use

2006-11-03  Sven Neumann  <sven@gimp.org>

	* app/dialogs/image-properties-dialog.c (image_comment_update)
	* app/text/gimptext-parasite.c (gimp_text_from_gdyntext_parasite):
	use gimp_any_to_utf8() to deal with invalid UTF-8 strings.
This commit is contained in:
Sven Neumann 2006-11-03 14:37:01 +00:00 committed by Sven Neumann
parent 568bbb9558
commit e7f921cb98
5 changed files with 22 additions and 17 deletions

View File

@ -1,3 +1,9 @@
2006-11-03 Sven Neumann <sven@gimp.org>
* app/dialogs/image-properties-dialog.c (image_comment_update)
* app/text/gimptext-parasite.c (gimp_text_from_gdyntext_parasite):
use gimp_any_to_utf8() to deal with invalid UTF-8 strings.
2006-11-03 Sven Neumann <sven@gimp.org>
* app/widgets/gimpimageparasiteview.[ch]: made non-abstract.

View File

@ -135,15 +135,15 @@ image_comment_update (GtkWidget *page,
gchar *text = g_strndup (gimp_parasite_data (parasite),
gimp_parasite_data_size (parasite));
if (g_utf8_validate (text, -1, NULL))
if (! g_utf8_validate (text, -1, NULL))
{
gtk_label_set_text (GTK_LABEL (label), text);
}
else
{
gtk_label_set_text (GTK_LABEL (label), _("(invalid UTF-8 string)"));
gchar *tmp = gimp_any_to_utf8 (text, -1, NULL);
g_free (text);
text = tmp;
}
gtk_label_set_text (GTK_LABEL (label), text);
g_free (text);
gtk_widget_show (page);

View File

@ -36,8 +36,6 @@
#include "gimptext-parasite.h"
#include "gimptext-xlfd.h"
#include "gimp-intl.h"
/****************************************/
/* The native GimpTextLayer parasite. */
@ -155,16 +153,10 @@ gimp_text_from_gdyntext_parasite (const GimpParasite *parasite)
if (! g_utf8_validate (text, -1, NULL))
{
gchar *utf8_str;
utf8_str = g_locale_to_utf8 (text, -1, NULL, NULL, NULL);
gchar *tmp = gimp_any_to_utf8 (text, -1, NULL);
g_free (text);
if (utf8_str)
text = utf8_str;
else
text = g_strdup (_("(invalid UTF-8 string)"));
text = tmp;
}
antialias = atoi (params[ANTIALIAS]) ? TRUE : FALSE;

View File

@ -1,3 +1,7 @@
2006-11-03 Sven Neumann <sven@gimp.org>
* POTFILES.in: updated.
2006-11-02 Jakub Friedl <jfriedl@suse.cz>
* cs.po: Updated Czech translation.

View File

@ -154,6 +154,7 @@ app/dialogs/convert-dialog.c
app/dialogs/desaturate-dialog.c
app/dialogs/dialogs-constructors.c
app/dialogs/dialogs.c
app/dialogs/fade-dialog.c
app/dialogs/file-open-dialog.c
app/dialogs/file-open-location-dialog.c
app/dialogs/file-save-dialog.c
@ -252,12 +253,12 @@ app/plug-in/gimppluginmanager.c
app/plug-in/gimppluginprocedure.c
app/plug-in/gimptemporaryprocedure.c
app/plug-in/plug-in-enums.c
app/plug-in/plug-in-icc-profile.c
app/plug-in/plug-in-rc.c
app/text/text-enums.c
app/text/gimpfont.c
app/text/gimptext-compat.c
app/text/gimptext-parasite.c
app/text/gimptextlayer.c
app/text/gimptextlayer-transform.c
app/text/gimptextlayer-xcf.c
@ -379,6 +380,7 @@ app/widgets/gimpgrideditor.c
app/widgets/gimphelp.c
app/widgets/gimphistogrameditor.c
app/widgets/gimpimagedock.c
app/widgets/gimpimageprofileview.c
app/widgets/gimpimagepropview.c
app/widgets/gimpitemtreeview.c
app/widgets/gimplayertreeview.c
@ -387,6 +389,7 @@ app/widgets/gimpmessagebox.c
app/widgets/gimppaletteeditor.c
app/widgets/gimppdbdialog.c
app/widgets/gimpprogressdialog.c
app/widgets/gimppropwidgets.c
app/widgets/gimpselectiondata.c
app/widgets/gimpselectioneditor.c
app/widgets/gimpsizebox.c