[gthumb] do not set the formatted value if it's not utf8 valid



commit 3236571dede6dfa7eef87fbbde333b3e7be4bd62
Author: Paolo Bacchilega <paobac src gnome org>
Date:   Fri Aug 20 17:51:29 2010 +0200

    do not set the formatted value if it's not utf8 valid

 extensions/exiv2_tools/exiv2-utils.cpp |    7 +++++--
 1 files changed, 5 insertions(+), 2 deletions(-)
---
diff --git a/extensions/exiv2_tools/exiv2-utils.cpp b/extensions/exiv2_tools/exiv2-utils.cpp
index 149516b..0c24f8e 100644
--- a/extensions/exiv2_tools/exiv2-utils.cpp
+++ b/extensions/exiv2_tools/exiv2-utils.cpp
@@ -39,6 +39,9 @@
 using namespace std;
 
 
+#define INVALID_VALUE "---"
+
+
 /* Some bits of information may be contained in more than one metadata tag.
    The arrays below define the valid tags for a particular piece of
    information, in decreasing order of preference (best one first) */
@@ -223,7 +226,7 @@ create_metadata (const char *key,
 		else
 			formatted_value_utf8 = g_locale_to_utf8 (formatted_value, -1, NULL, NULL, NULL);
 		if (formatted_value_utf8 == NULL)
-			formatted_value_utf8 = g_strdup (formatted_value);
+			formatted_value_utf8 = g_strdup (INVALID_VALUE);
 	}
 	else {
 		const char *formatted_clean;
@@ -234,7 +237,7 @@ create_metadata (const char *key,
 			formatted_clean = formatted_value;
 		formatted_value_utf8 = g_locale_to_utf8 (formatted_clean, -1, NULL, NULL, NULL);
 		if (formatted_value_utf8 == NULL)
-			formatted_value_utf8 = g_strdup (formatted_clean);
+			formatted_value_utf8 = g_strdup (INVALID_VALUE);
 	}
 
 	metadata_info = gth_main_get_metadata_info (attribute);



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]