Warn if a UTF8_STRING or text/plain;charset=utf-8 roperty contains invalid
Thu Sep 16 23:20:05 2004 Matthias Clasen <maclas@gmx.de> * gtk/gtkselection.c (selection_get_text_plain): * gdk/x11/gdkselection-x11.c (make_list): Warn if a UTF8_STRING or text/plain;charset=utf-8 roperty contains invalid UTF-8. (#152845, Owen Taylor)
This commit is contained in:
		
				
					committed by
					
						
						Matthias Clasen
					
				
			
			
				
	
			
			
			
						parent
						
							ec6f32e14a
						
					
				
				
					commit
					5717212948
				
			@ -1,3 +1,10 @@
 | 
			
		||||
Thu Sep 16 23:20:05 2004  Matthias Clasen  <maclas@gmx.de>
 | 
			
		||||
 | 
			
		||||
	* gtk/gtkselection.c (selection_get_text_plain): 
 | 
			
		||||
	* gdk/x11/gdkselection-x11.c (make_list): Warn if a UTF8_STRING
 | 
			
		||||
	or text/plain;charset=utf-8 roperty contains invalid 
 | 
			
		||||
	UTF-8.  (#152845, Owen Taylor)
 | 
			
		||||
 | 
			
		||||
2004-09-16  Matthias Clasen  <mclasen@redhat.com>
 | 
			
		||||
 | 
			
		||||
	Fix #152760, Christian Persch:
 | 
			
		||||
 | 
			
		||||
@ -1,3 +1,10 @@
 | 
			
		||||
Thu Sep 16 23:20:05 2004  Matthias Clasen  <maclas@gmx.de>
 | 
			
		||||
 | 
			
		||||
	* gtk/gtkselection.c (selection_get_text_plain): 
 | 
			
		||||
	* gdk/x11/gdkselection-x11.c (make_list): Warn if a UTF8_STRING
 | 
			
		||||
	or text/plain;charset=utf-8 roperty contains invalid 
 | 
			
		||||
	UTF-8.  (#152845, Owen Taylor)
 | 
			
		||||
 | 
			
		||||
2004-09-16  Matthias Clasen  <mclasen@redhat.com>
 | 
			
		||||
 | 
			
		||||
	Fix #152760, Christian Persch:
 | 
			
		||||
 | 
			
		||||
@ -1,3 +1,10 @@
 | 
			
		||||
Thu Sep 16 23:20:05 2004  Matthias Clasen  <maclas@gmx.de>
 | 
			
		||||
 | 
			
		||||
	* gtk/gtkselection.c (selection_get_text_plain): 
 | 
			
		||||
	* gdk/x11/gdkselection-x11.c (make_list): Warn if a UTF8_STRING
 | 
			
		||||
	or text/plain;charset=utf-8 roperty contains invalid 
 | 
			
		||||
	UTF-8.  (#152845, Owen Taylor)
 | 
			
		||||
 | 
			
		||||
2004-09-16  Matthias Clasen  <mclasen@redhat.com>
 | 
			
		||||
 | 
			
		||||
	Fix #152760, Christian Persch:
 | 
			
		||||
 | 
			
		||||
@ -1,3 +1,10 @@
 | 
			
		||||
Thu Sep 16 23:20:05 2004  Matthias Clasen  <maclas@gmx.de>
 | 
			
		||||
 | 
			
		||||
	* gtk/gtkselection.c (selection_get_text_plain): 
 | 
			
		||||
	* gdk/x11/gdkselection-x11.c (make_list): Warn if a UTF8_STRING
 | 
			
		||||
	or text/plain;charset=utf-8 roperty contains invalid 
 | 
			
		||||
	UTF-8.  (#152845, Owen Taylor)
 | 
			
		||||
 | 
			
		||||
2004-09-16  Matthias Clasen  <mclasen@redhat.com>
 | 
			
		||||
 | 
			
		||||
	Fix #152760, Christian Persch:
 | 
			
		||||
 | 
			
		||||
@ -516,7 +516,15 @@ make_list (const gchar  *text,
 | 
			
		||||
	    }
 | 
			
		||||
	}
 | 
			
		||||
      else
 | 
			
		||||
	{
 | 
			
		||||
	  str = g_strndup (p, q - p);
 | 
			
		||||
	  if (!g_utf8_validate (str, -1, NULL))
 | 
			
		||||
	    {
 | 
			
		||||
	      g_warning ("Error converting selection from UTF8_STRING");
 | 
			
		||||
	      g_free (str);
 | 
			
		||||
	      str = NULL;
 | 
			
		||||
	    }
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
      if (str)
 | 
			
		||||
	{
 | 
			
		||||
 | 
			
		||||
@ -1032,7 +1032,6 @@ selection_get_text_plain (GtkSelectionData *selection_data)
 | 
			
		||||
				     charset, "UTF-8", 
 | 
			
		||||
				     NULL, NULL, &len, &error);
 | 
			
		||||
      g_free (tmp);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
      if (!str)
 | 
			
		||||
	{
 | 
			
		||||
@ -1042,10 +1041,16 @@ selection_get_text_plain (GtkSelectionData *selection_data)
 | 
			
		||||
 | 
			
		||||
	  return NULL;
 | 
			
		||||
	}
 | 
			
		||||
    }
 | 
			
		||||
  else if (!g_utf8_validate (str, -1, NULL))
 | 
			
		||||
    {
 | 
			
		||||
      g_warning ("Error converting from text/plain;charset=utf-8 to UTF-8");
 | 
			
		||||
      g_free (str);
 | 
			
		||||
 | 
			
		||||
      return NULL;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
  result = normalize_to_lf (str, len);
 | 
			
		||||
 | 
			
		||||
  g_free (str);
 | 
			
		||||
 | 
			
		||||
  return result;
 | 
			
		||||
 | 
			
		||||
		Reference in New Issue
	
	Block a user