diff -urN intltool-old/intltool-extract.in.in intltool/intltool-extract.in.in
--- intltool-old/intltool-extract.in.in	2005-08-01 11:34:42.000000000 +0500
+++ intltool/intltool-extract.in.in	2005-11-24 23:14:03.000000000 +0500
@@ -485,10 +485,12 @@
 sub intltool_tree_comment
 {
     my $expat = shift;
-    my $data  = shift;
+    my $data  = $expat->original_string();
     my $clist = $expat->{Curlist};
     my $pos   = $#$clist;
 
+    $data =~ s/^<!--//s;
+    $data =~ s/-->$//s;
     push @$clist, 1 => $data;
 }
 
diff -urN intltool-old/tests/cases/iso88591text.xml.in intltool/tests/cases/iso88591text.xml.in
--- intltool-old/tests/cases/iso88591text.xml.in	1970-01-01 06:00:00.000000000 +0600
+++ intltool/tests/cases/iso88591text.xml.in	2005-11-24 23:23:55.000000000 +0500
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="iso-8859-1"?>
+<!DOCTYPE gweather SYSTEM "locations.dtd">
+<gweather format="1.0">
+<!-- Here we demonstrate how intltools behave 
+when comments or _name names contain non-US-ASCII 
+characters.
+-->
+<region>
+  <_name>Europe</_name>
+  <country>
+    <city>
+      <!-- Translators: This is in France. -->
+      <_name>Chambéry</_name>
+      <location>
+        <!-- Translators: This is in Chambéry in France. -->
+        <_name>Aix-les-Bains</_name>
+        <code>LFLB</code>
+        <coordinates>45-39N 005-53E</coordinates>
+      </location>
+    </city>
+  </country>
+</region>
+</gweather>
diff -urN intltool-old/tests/cases/Makefile.am intltool/tests/cases/Makefile.am
--- intltool-old/tests/cases/Makefile.am	2005-06-26 17:01:28.000000000 +0500
+++ intltool/tests/cases/Makefile.am	2005-11-24 23:22:54.000000000 +0500
@@ -15,6 +15,7 @@
 	fr.po					\
 	fr_BE.po				\
 	fr_FR.po				\
+	iso88591text.xml.in			\
 	merge-cdata.xml.in			\
 	merge-deepattr.xml.in			\
 	merge1.xml.in				\
@@ -34,6 +35,7 @@
 	test.po 				\
 	test.schemas.in				\
 	test.scm				\
+	unicodetext.xml.in			\
 	$(NULL)
 
 CLEANFILES =					\
@@ -42,6 +44,7 @@
 	extract12.xml.in.h			\
 	extract9.xml				\
 	extract9.xml.in.h			\
+	iso88591text.xml.in.h			\
 	merge-cdata.xml				\
 	merge-deepattr.xml			\
 	merge10.templates			\
@@ -51,4 +54,5 @@
 	test.schemas				\
 	test.schemas.in.h			\
 	test.scm.h				\
+	unicodetext.xml.in.h			\
 	$(NULL)
diff -urN intltool-old/tests/cases/unicodetext.xml.in intltool/tests/cases/unicodetext.xml.in
--- intltool-old/tests/cases/unicodetext.xml.in	1970-01-01 06:00:00.000000000 +0600
+++ intltool/tests/cases/unicodetext.xml.in	2005-11-24 23:14:11.000000000 +0500
@@ -0,0 +1,23 @@
+<?xml version="1.0"?>
+<!DOCTYPE gweather SYSTEM "locations.dtd">
+<gweather format="1.0">
+<!-- Here we demonstrate how intltools behave 
+when comments or _name names contain non-US-ASCII 
+characters.
+-->
+<region>
+  <_name>Europe</_name>
+  <country>
+    <city>
+      <!-- Translators: This is in France. -->
+      <_name>ChambĂ©ry</_name>
+      <location>
+        <!-- Translators: This is in ChambĂ©ry in France. -->
+        <_name>Aix-les-Bains</_name>
+        <code>LFLB</code>
+        <coordinates>45-39N 005-53E</coordinates>
+      </location>
+    </city>
+  </country>
+</region>
+</gweather>
diff -urN intltool-old/tests/results/iso88591text.xml.in.h intltool/tests/results/iso88591text.xml.in.h
--- intltool-old/tests/results/iso88591text.xml.in.h	1970-01-01 06:00:00.000000000 +0600
+++ intltool/tests/results/iso88591text.xml.in.h	2005-11-24 23:24:10.000000000 +0500
@@ -0,0 +1,5 @@
+/*  Translators: This is in Chambéry in France.  */
+char *s = N_("Aix-les-Bains");
+/*  Translators: This is in France.  */
+char *s = N_("Chambéry");
+char *s = N_("Europe");
diff -urN intltool-old/tests/results/Makefile.am intltool/tests/results/Makefile.am
--- intltool-old/tests/results/Makefile.am	2005-06-26 17:01:28.000000000 +0500
+++ intltool/tests/results/Makefile.am	2005-11-24 23:29:44.000000000 +0500
@@ -11,6 +11,7 @@
 	extract9.xml				\
 	extract9.xml.in.h			\
 	extract12.xml.in.h			\
+	iso88591text.xml.h			\
 	merge-cdata.xml				\
 	merge-deepattr.xml			\
 	merge1.xml				\
@@ -28,4 +29,5 @@
 	test.schemas				\
 	test.schemas.in.h			\
 	test.scm.h				\
+	unicodetext.xml.in.h			\
 	$(NULL)
diff -urN intltool-old/tests/results/unicodetext.xml.in.h intltool/tests/results/unicodetext.xml.in.h
--- intltool-old/tests/results/unicodetext.xml.in.h	1970-01-01 06:00:00.000000000 +0600
+++ intltool/tests/results/unicodetext.xml.in.h	2005-11-24 23:14:11.000000000 +0500
@@ -0,0 +1,5 @@
+/*  Translators: This is in ChambĂ©ry in France.  */
+char *s = N_("Aix-les-Bains");
+/*  Translators: This is in France.  */
+char *s = N_("ChambĂ©ry");
+char *s = N_("Europe");
diff -urN intltool-old/tests/selftest.pl.in intltool/tests/selftest.pl.in
--- intltool-old/tests/selftest.pl.in	2005-06-26 17:04:15.000000000 +0500
+++ intltool/tests/selftest.pl.in	2005-11-24 23:27:19.000000000 +0500
@@ -226,7 +226,16 @@
 $case = "merge11.xml";
 system("$INTLTOOL_MERGE -x --quiet cases cases/$case.in cases/$case") == 0 or $failed = 1;
 check_merge_result($case);
+ 
+print "28. Extract UTF-8 encoded messages/comments from xml file:           ";
+$case = "unicodetext.xml.in";
+system("$INTLTOOL_EXTRACT --type=gettext/xml --quiet --update cases/$case") == 0 or $failed = 1;
+check_extract_result($case);
 
+print "29. Extract iso-8859-1 encoded messages/comments from xml file:      ";
+$case = "iso88591text.xml.in";
+system("$INTLTOOL_EXTRACT --type=gettext/xml --quiet --update cases/$case") == 0 or $failed = 1;
+check_extract_result($case);
 
 system("rm -f cases/*.*") if $srcdir ne ".";
 system("rm -rf az extract9 fr fr_BE fr_FR merge6 schemasmerge1 schemasmerge2 spacepreserve test merge6.xml");
