Still a bit underwhelming as we can't express the encoding
difference in the type system.
std::string html_entities(std::string str);
std::string html_entities_to_console(std::string str);
+inline std::string html_entities_iso (const std::string &str)
+{
+ return html_entities (iso_to_utf8 (str));
+}
+
typedef std::pair<std::string::size_type, std::string::size_type> CommentZone;
std::vector<CommentZone> find_html_comments(const std::string &str);
void remove_html_comments(std::string &str);
BOOST_CHECK_EQUAL(string("Ď ༱ 肈"), output);
}
+BOOST_AUTO_TEST_CASE(entities_latin1)
+{
+ BOOST_CHECK_EQUAL((std::string)"noop", html_entities_iso ("noop"));
+ BOOST_CHECK_EQUAL((std::string)"täst", html_entities_iso ("t\xe4st"));
+ BOOST_CHECK_EQUAL((std::string)"TÄST", html_entities_iso ("T\xc4ST"));
+}
BOOST_AUTO_TEST_CASE(nice_unit_format1)