diff -ruN rssvalidator/src/feedvalidator/base.py rssvalidator.improved/src/feedvalidator/base.py --- rssvalidator/src/feedvalidator/base.py 2003-12-11 11:32:08.000000000 +0000 +++ rssvalidator.improved/src/feedvalidator/base.py 2004-01-28 03:42:51.000000000 +0000 @@ -257,6 +257,11 @@ self.log(ValidElement({"parent":self.parent.name, "element":name})) def characters(self, string): + for c in string: + if 0x80 <= ord(c) <= 0x9F: + from validators import BadCharacters + self.log(BadCharacters({"parent":self.parent.name, "element":self.name})) + self.value = self.value + string def log(self, event): diff -ruN rssvalidator/src/feedvalidator/i18n/en.py rssvalidator.improved/src/feedvalidator/i18n/en.py --- rssvalidator/src/feedvalidator/i18n/en.py 2003-12-12 15:37:06.000000000 +0000 +++ rssvalidator.improved/src/feedvalidator/i18n/en.py 2004-01-28 03:51:58.000000000 +0000 @@ -84,7 +84,8 @@ MissingHref: "%(element)s must have an href attribute", AtomLinkNotEmpty: "%(element)s should not have text (all data is in attributes)", AtomLinkMissingRel: "%(element)s must have a rel attribute", - MissingAlternateLink: '''%(parent)s must contain a link element with rel="alternate"''' + MissingAlternateLink: '''%(parent)s must contain a link element with rel="alternate"''', + BadCharacters: '%(element)s contains bad characters' } diff -ruN rssvalidator/src/feedvalidator/logging.py rssvalidator.improved/src/feedvalidator/logging.py --- rssvalidator/src/feedvalidator/logging.py 2003-12-12 10:00:22.000000000 +0000 +++ rssvalidator.improved/src/feedvalidator/logging.py 2004-01-28 03:29:41.000000000 +0000 @@ -101,6 +101,8 @@ class ContainsEmbed(SecurityRisk): pass class ContainsObject(SecurityRisk): pass +class BadCharacters(Warning): pass + ###################### info ###################### class ContainsHTML(Info): pass diff -ruN rssvalidator/testcases/rss/should/xml_bad_encoding_declaration.xml rssvalidator.improved/testcases/rss/should/xml_bad_encoding_declaration.xml --- rssvalidator/testcases/rss/should/xml_bad_encoding_declaration.xml 1970-01-01 01:00:00.000000000 +0100 +++ rssvalidator.improved/testcases/rss/should/xml_bad_encoding_declaration.xml 2004-01-28 03:40:26.000000000 +0000 @@ -0,0 +1,16 @@ + + + + + + + +Foo +http://purl.org/rss/2.0/?item +This is a £“test.” + + + diff -ruN rssvalidator/testcases/rss/should/xml_correct_encoding_declaration.xml rssvalidator.improved/testcases/rss/should/xml_correct_encoding_declaration.xml --- rssvalidator/testcases/rss/should/xml_correct_encoding_declaration.xml 1970-01-01 01:00:00.000000000 +0100 +++ rssvalidator.improved/testcases/rss/should/xml_correct_encoding_declaration.xml 2004-01-28 03:55:17.000000000 +0000 @@ -0,0 +1,16 @@ + + + + + + + +Foo +http://purl.org/rss/2.0/?item +This is a £“test.” + + +