Commit d82bea5d authored by Paolo Maggi's avatar Paolo Maggi Committed by Paolo Maggi

replace unknown characters by the Unicode replacement character instead of

2006-02-12  Paolo Maggi  <paolo@gnome.org>

	* gedit/gedit-utils.c (gedit_utils_make_valid_utf8): replace
	unknown characters by the Unicode replacement character
	instead of '?', and don't append "(invalid encoding)".
parent 7e86c71a
2006-02-12 Paolo Maggi <paolo@gnome.org>
* gedit/gedit-utils.c (gedit_utils_make_valid_utf8): replace
unknown characters by the Unicode replacement character
instead of '?', and don't append "(invalid encoding)".
2006-02-12 Paolo Borelli <pborelli@katamail.com>
* gedit/gedit-view.c: use gtk_widget_get_clipboard instead of
......
......@@ -643,7 +643,8 @@ gedit_utils_make_valid_utf8 (const char *name)
string = g_string_sized_new (remaining_bytes);
}
g_string_append_len (string, remainder, valid_bytes);
g_string_append_c (string, '?');
/* append U+FFFD REPLACEMENT CHARACTER */
g_string_append (string, "\357\277\275");
remaining_bytes -= valid_bytes + 1;
remainder = invalid + 1;
......@@ -654,7 +655,6 @@ gedit_utils_make_valid_utf8 (const char *name)
}
g_string_append (string, remainder);
g_string_append (string, " (invalid encoding)");
g_assert (g_utf8_validate (string->str, -1, NULL));
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment