anjuta r3656 - in trunk: . plugins/subversion



Author: jhs
Date: Thu Feb 14 09:16:13 2008
New Revision: 3656
URL: http://svn.gnome.org/viewvc/anjuta?rev=3656&view=rev

Log:
2008-02-13  James Liggett <jrliggett cox net>

	* plugins/subversion/svn-diff-command.c: (svn_diff_command_run):
	Output in UTF-8 format to avoid hangs with the editor. (#516014)

Modified:
   trunk/ChangeLog
   trunk/plugins/subversion/svn-diff-command.c

Modified: trunk/plugins/subversion/svn-diff-command.c
==============================================================================
--- trunk/plugins/subversion/svn-diff-command.c	(original)
+++ trunk/plugins/subversion/svn-diff-command.c	Thu Feb 14 09:16:13 2008
@@ -151,7 +151,17 @@
 		if (strlen (line))
 		{
 			anjuta_async_command_lock (ANJUTA_ASYNC_COMMAND (command));
-			g_queue_push_tail (self->priv->output, g_strdup (line));
+			
+			/* Make sure that we only output UTF-8. We could have done this by
+			 * passing in "UTF-8" for header encoding to the diff API, but there
+			 * is the possiblity that an external diff program could be used, in
+			 * which case that arguement wouldn't do anything. As a workaround,
+			 * have the internal diff system return things in the system 
+			 * charset, and make the (hopefully safe) assumption that any 
+			 * external diff program also outputs in the current locale. */
+			g_queue_push_tail (self->priv->output, 
+							   g_locale_to_utf8 (line, read_size, NULL, NULL,
+												 NULL));
 			anjuta_async_command_unlock (ANJUTA_ASYNC_COMMAND (command));
 			
 			g_free (line);



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