summaryrefslogtreecommitdiff
path: root/src/test/importtest.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/test/importtest.cpp')
-rw-r--r--src/test/importtest.cpp18
1 files changed, 18 insertions, 0 deletions
diff --git a/src/test/importtest.cpp b/src/test/importtest.cpp
index d9100bc..d25380d 100644
--- a/src/test/importtest.cpp
+++ b/src/test/importtest.cpp
@@ -94,9 +94,13 @@ class ImportTest : public CPPUNIT_NS::TestFixture
{
CPPUNIT_TEST_SUITE(ImportTest);
CPPUNIT_TEST(testVsdxMetadataTitle);
+ CPPUNIT_TEST(testVsdMetadataTitleMs1252);
+ CPPUNIT_TEST(testVsdMetadataTitleUtf8);
CPPUNIT_TEST_SUITE_END();
void testVsdxMetadataTitle();
+ void testVsdMetadataTitleMs1252();
+ void testVsdMetadataTitleUtf8();
xmlBufferPtr m_buffer;
xmlDocPtr m_doc;
@@ -141,6 +145,20 @@ void ImportTest::testVsdxMetadataTitle()
assertXPath(m_doc, "/document/setDocumentMetaData", "date", "2014-11-24T10:41:22Z");
}
+void ImportTest::testVsdMetadataTitleMs1252()
+{
+ m_doc = parse("fdo86729-ms1252.vsd", m_buffer);
+ // Test windows-1252 -> UTF-8 conversion, provided by ICU.
+ assertXPath(m_doc, "/document/setDocumentMetaData", "title", "mytitle\xC3\xA9\xC3\xA1");
+}
+
+void ImportTest::testVsdMetadataTitleUtf8()
+{
+ m_doc = parse("fdo86729-utf8.vsd", m_buffer);
+ // Test the case when the string is UTF-8 encoded already in the file.
+ assertXPath(m_doc, "/document/setDocumentMetaData", "title", "mytitle\xC3\xA9\xC3\xA1\xC5\x91\xC5\xB1");
+}
+
CPPUNIT_TEST_SUITE_REGISTRATION(ImportTest);
/* vim:set shiftwidth=2 softtabstop=2 expandtab: */