--- imap_csim_parse.c.orig	2013-03-03 12:37:48.922979651 +0530
+++ imap_csim_parse.c	2013-03-05 00:31:14.129437591 +0530
@@ -116,6 +116,8 @@
 extern int csim_lex(void);
 extern int csim_restart(FILE *csim_in);
 static void csim_error(char* s);
+static gchar* unescape_text(const gchar *);
+static void append_unescaped_text (GString*, const gchar*, gint);
 
 static enum {UNDEFINED, RECTANGLE, CIRCLE, POLYGON} current_type;
 static Object_t *current_object;
@@ -1764,7 +1766,7 @@
 /* Line 1464 of yacc.c  */
 #line 282 "imap_csim.y"
     {
-		   object_set_comment(current_object, (yyvsp[(3) - (3)].id));
+		   object_set_comment(current_object, unescape_text((yyvsp[(3) - (3)].id)));
 		   g_free ((yyvsp[(3) - (3)].id));
 		}
     break;
@@ -1774,7 +1776,7 @@
 /* Line 1464 of yacc.c  */
 #line 289 "imap_csim.y"
     {
-		   object_set_target(current_object, (yyvsp[(3) - (3)].id));
+		   object_set_target(current_object, unescape_text((yyvsp[(3) - (3)].id)));
 		   g_free ((yyvsp[(3) - (3)].id));
 		}
     break;
@@ -1784,7 +1786,7 @@
 /* Line 1464 of yacc.c  */
 #line 296 "imap_csim.y"
     {
-		   object_set_mouse_over(current_object, (yyvsp[(3) - (3)].id));
+		   object_set_mouse_over(current_object, unescape_text((yyvsp[(3) - (3)].id)));
 		   g_free ((yyvsp[(3) - (3)].id));
 		}
     break;
@@ -1794,7 +1796,7 @@
 /* Line 1464 of yacc.c  */
 #line 303 "imap_csim.y"
     {
-		   object_set_mouse_out(current_object, (yyvsp[(3) - (3)].id));
+		   object_set_mouse_out(current_object, unescape_text((yyvsp[(3) - (3)].id)));
 		   g_free ((yyvsp[(3) - (3)].id));
 		}
     break;
@@ -1804,7 +1806,7 @@
 /* Line 1464 of yacc.c  */
 #line 310 "imap_csim.y"
     {
-		   object_set_focus(current_object, (yyvsp[(3) - (3)].id));
+		   object_set_focus(current_object, unescape_text((yyvsp[(3) - (3)].id)));
 		   g_free ((yyvsp[(3) - (3)].id));
 		}
     break;
@@ -1814,7 +1816,7 @@
 /* Line 1464 of yacc.c  */
 #line 317 "imap_csim.y"
     {
-		   object_set_blur(current_object, (yyvsp[(3) - (3)].id));
+		   object_set_blur(current_object, unescape_text((yyvsp[(3) - (3)].id)));
 		   g_free ((yyvsp[(3) - (3)].id));
 		}
     break;
@@ -2060,3 +2062,56 @@
   return status;
 }
 
+static gchar*
+unescape_text (const gchar *text)
+{
+  GString *str;
+  gint length = strlen (text);
+
+  str = g_string_sized_new (length);
+  append_unescaped_text (str, text, length);
+
+  return g_string_free (str, FALSE);
+}
+
+static void
+append_unescaped_text (GString     *str,
+                       const gchar *text,
+                       gint       length)
+{
+  const gchar *p, *end;
+  p = text;
+  end = text + length;
+  
+  while (p < end)
+  {
+    if (*p == '&') {
+      p++;
+      if (strncmp(p, "amp;", 4) == 0) {
+        g_string_append_c (str, '&');
+        p = p + 4;
+      }        
+      else if (strncmp(p, "lt;", 3) == 0) {
+        g_string_append_c (str, '<');
+        p = p + 3;
+      }      
+      else if (strncmp(p, "gt;", 3) == 0) {
+        g_string_append_c (str, '>');
+        p = p + 3;
+      } 
+      else if (strncmp(p, "apos;", 5) == 0) {
+        g_string_append_c (str, '\'');
+        p = p + 5;
+      }
+      else if (strncmp(p, "quot;", 5) == 0) {
+        g_string_append_c (str, '"');
+        p = p + 5;
+      } 
+    }
+    else {
+      g_string_append_len (str, p, 1);
+      p++;
+    }
+  }
+}
+
